Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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.
} 
Comment

read line by line php

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

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

	$file = null;

?>
Comment

PREVIOUS NEXT
Code Example
Php :: whereNull in laravel 
Php :: refresh seeder laravel 
Php :: opencart order change status 
Php :: PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: 
Php :: php function to remove underscore 
Php :: composer install ignore 
Php :: php memory_limit cli 
Php :: php loop through start and end date 
Php :: inrandomorder laravel 
Php :: You must enable the openssl extension in your php.ini to load information from https://repo.packagist.org 
Php :: string replace twig 
Php :: php how to get am pm from a datetime 
Php :: php add hours to current date 
Php :: laravel migration data types 
Php :: php file_get_contents disable ssl check 
Php :: Syntax error or access violation: 1071 La clé est trop longue. Longueur maximale: 1000 
Php :: ubuntu update php 7.4 to 8 
Php :: php timezone asia dhaka 
Php :: php get user ip 
Php :: how to remove index.php in codeigniter 
Php :: set nav link active on the basis of route laravel 
Php :: php compare two dates 
Php :: tmp cakephp name 
Php :: eloquent run seeder 
Php :: wp revisions 0 
Php :: php change timezone 
Php :: node dockerfile 
Php :: php get id from url 
Php :: laravel find or fail exception 
Php :: php ip address of visitor 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =