“PHP Baca File Line By Line” Kode Jawaban

PHP Baca 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.
} 
Friendly Hawk

Baca baris demi baris php

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

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

	$file = null;

?>
Powerful Pony

Jawaban yang mirip dengan “PHP Baca File Line By Line”

Pertanyaan yang mirip dengan “PHP Baca File Line By Line”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya