Hello Reader's If you need to read a given file line by line then PHP will offer you to use Fgets to do.
Lets see it's example as below:-
$handle = fopen("yourfile.txt", "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
// process the line read. you can make further code here
}
fclose($handle);
} else {
// error opening the file. show to user
}
0 Comment(s)