Answers for "php loop through lines of file"

PHP
1

get file each line in php

$filecreate = fopen($filename,'r');
while (($line = fgets($filecreate)) !== false) {
    echo $line;
}
Posted by: Guest on December-01-2021
0

php loop through lines of file

$contents = file("myfile.txt");
foreach($contents as $line) {
    echo $line;
}
Posted by: Guest on February-08-2022

Code answers related to "php loop through lines of file"

Browse Popular Code Answers by Language