1$row = 1;
2if (($handle = fopen("test.csv", "r")) !== FALSE) {
3 while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
4 $num = count($data);
5 echo "<p> $num fields in line $row: <br /></p>\n";
6 $row++;
7 for ($c=0; $c < $num; $c++) {
8 echo $data[$c] . "<br />\n";
9 }
10 }
11 fclose($handle);
12}
13