Page 1 of 1

reading csv file by line

Posted: Fri Dec 19, 2008 12:12 am
by itsmani1
Hi all


I want to read a csv file line by line. What should be the 2nd argument of fread so that i can read line by line

Code: Select all

 
 
if (!$handle = fopen($filename, 'w+'))
{
    echo "Cannot open file ($filename)";
    exit;
}
else
{
        fread($handle,....);
        fclose($handle);
}
 

Re: reading csv file by line

Posted: Fri Dec 19, 2008 12:25 am
by requinix
Use fgetcsv instead of fread.