how extract data from huge csv file to php? -
i have long csv file tens of columns , thousands of rows. need fetch info on specific info csv using php.
the csv file at: http://www.ezmedia2u.com/software/hworiginal.csv .
the info sample want line 1203 line 1275, 'entire page', , need display in table format.
if want fetch info csv file seek this.
<?php $fp = fopen('test.csv','r') or die("can't open file"); print "<table>\n"; while($csv_line = fgetcsv($fp,1024)) { print '<tr>'; ($i = 0, $j = count($csv_line); $i < $j; $i++) { print '<td>'.$csv_line[$i].'</td>'; } print "</tr>\n"; } print '</table>\n'; fclose($fp) or die("can't close file"); ?>
php csv
No comments:
Post a Comment