mysql - How to parse CSV files in PHP -
i want stock fields in mysql coming excel i'm not arrived cut lines excel in php
example:
123,15,0,01/01/2000,456462abcd,,,
any please ?
just use function parsing csv file
http://php.net/manual/en/function.fgetcsv.php
$row = 1; if (($handle = fopen("test.csv", "r")) !== false) { while (($data = fgetcsv($handle, 1000, ",")) !== false) { $num = count($data); echo "<p> $num fields in line $row: <br /></p>\n"; $row++; ($c=0; $c < $num; $c++) { echo $data[$c] . "<br />\n"; } } fclose($handle); }
Comments
Post a Comment