Answers for "php read text file line by line to array"

PHP
3

php read file line by line

$handle = fopen("inputfile.txt", "r");
if ($handle) {
    while (($line = fgets($handle)) !== false) {
        // process the line read.
    }

    fclose($handle);
} else {
    // error opening the file.
}
Posted by: Guest on May-22-2020
0

read file and convert each line in array php

$lines = file($filename, FILE_IGNORE_NEW_LINES);
Posted by: Guest on October-06-2020

Code answers related to "php read text file line by line to array"

Browse Popular Code Answers by Language