"data", "data1", "data2", "data3"
"data", "data1", "data2", "data3"
"data", "data1", "data2", "data3"
You can use fgetcsv to parse a CSV file without having to worry about parsing it yourself.
example from php.net
<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ $row = 1; if (($handle = fopen("test.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); echo "$num fields in line $row:
\n"; $row++; for ($c=0; $c < $num; $c++) { echo $data[$c] . " \n"; } } fclose($handle); } ?>
0 comments:
Post a Comment