Thursday, February 27, 2014

How to read a text file line by line using php??

How to read a text file line by line using php??


$handle = fopen(sample.txt”, "r");
if ($handle) {

while (($linetext= fgets($handle)) !== false) {
                     
echo $linetext;
}else{

            // Error Show while reading file
}

fclose($handle);

Thanks.

I hope that it will help you...

No comments:

Post a Comment