!! 修改 !!出于某种原因,它只打印一行 csv,并重复打印国家?
<?php
$file = fopen('storelistdata.csv', 'r');
while (($line = fgetcsv($file)) !== FALSE) {
list($country[], $state[], $city[], $loc[]) = $line;
$arrayLength = count($line);
$i = 0;
while ($i < $arrayLength) {
echo "<a class=\"item\">" . $loc[$i] .",". $city[$i] .",". $state[$i] .",".$country[$i] . "<a/></br>";
$i++;
}
}
fclose($file);
?>