“Leia linha por linha PHP” Respostas de código

PHP Leia o arquivo linha por linha

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

    fclose($handle);
} else {
    // error opening the file.
} 
Friendly Hawk

Leia linha por linha PHP

<?php
	
	$file = new SplFileObject("file.txt");

	while(!$file->eof())
	  {
		echo $file->fgets()."<br/>";
	  }

	$file = null;

?>
Powerful Pony

Respostas semelhantes a “Leia linha por linha PHP”

Perguntas semelhantes a “Leia linha por linha PHP”

Procure respostas de código populares por idioma

Procurar outros idiomas de código