Parse a line from an open file, checking for CSV fields in PHP
Description
The following code shows how to parse a line from an open file, checking for CSV fields.
Example
/*w w w. ja va 2s. com*/
<?php
$file = fopen("data.csv","r");
print_r(fgetcsv($file));
fclose($file);
$file = fopen("data.csv","r");
while(! feof($file)){
print_r(fgetcsv($file));
}
fclose($file);
?>