Read the data of all rows in the csv file at one time
}
} */
echo $goods_list[2][0];
fclose($file);
?>
Read a certain row of data from the csv file Read the csv file and specify the number of lines (line interval) Two other methods found online (haven’t tested it, so I don’t know if it works) $handle=fopen("1.csv","r"); Code 2,
}
?>
while(!feof($handle)){
$buffer=fgetss($handle,2048);
$ data=explode(",",$buffer);
$num=count($data);
for($i=0;$i<$num;$i++){
print_r($ data);
}
}
?>>
$handle=fopen("1.csv","r");
$row=1;
while($data=fgetcsv($handle,1000,", ")){
$num=count($data);
for($i=0;$i<$num;$i++){
echo $data[$i];
}
$row++;
}
?>