在PHP中覆盖CSV文件时跳过第一行



我需要在覆盖文件时跳过第一行的帮助。因为我得到的日期在第一行,我想把一个标题。比如日期名称等等。我试过continue;,但它不起作用。

$result =[];
foreach($sumArray as $key => $totalItems)   {
$result[$totalItems][ ]= $sumArray1[$key];
$timeNeeded = implode(" ", $result[$totalItems]);
list($id1, $name1) = explode('_', $key);
$rows = 0;
$procenti = round(($perMin*$totalItems)/($timeNeeded/$precentEff),2);
$procentiCon = $procenti . " %";
$pickingEffRes = [$name1 , $totalItems, $procentiCon];

if($rows == 1) continue;

fputcsv($out, $pickingEffRes);
$rows++;
}  
$result =[];
$rows = 0;
foreach($sumArray as $key => $totalItems)   {
$result[$totalItems][ ]= $sumArray1[$key];
$timeNeeded = implode(" ", $result[$totalItems]);
list($id1, $name1) = explode('_', $key);
$procenti = round(($perMin*$totalItems)/($timeNeeded/$precentEff),2);
$procentiCon = $procenti . " %";
$pickingEffRes = [$name1 , $totalItems, $procentiCon];

if($rows == 1) continue;

fputcsv($out, $pickingEffRes);
$rows++;
}  

最新更新