fgetcsv 数组打印失败

!! 修改 !!出于某种原因,它只打印一行 csv,并重复打印国家?

http://img4.mukewang.com/60cd4cd4000198f907190273.jpg

http://img4.mukewang.com/60cd4cde00011ae007640610.jpg

<?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);

?>


慕莱坞森
浏览 159回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP