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 :: laravel eloquent get specific columns using with function 
Php :: merge array 
Php :: cviebrock/eloquent-sluggable 
Php :: php ical 
Php :: Install Older Version of Laravel using Composer 
Php :: give custom field name in laravel form validation error message 
Php :: str_shuffle in php 
Php :: strtotime to date php 
Php :: time function in php 
Php :: how to show image from php 
Php :: ubuntu install php 
Php :: php how to connect to db using PDO 
Php :: md5 (PHP 4, PHP 5, PHP 7, PHP 8) md5 — Calculate the md5 hash of a string 
Php :: add bootstrap class to checkout fields woocommerce 
Php :: adminlte 3 laravel 
Php :: file upload codeigniter 
Php :: laravel amount migration 
Php :: instalar php 7.4 no ubuntu 
Php :: new DateInterval 1 hour 
Php :: php concat objects 
Php :: laravel update all relations 
Php :: laravel drop table migration 
Php :: merge collections laravel 
Php :: php write to standard out 
Php :: laravel check if email is real 
Php :: php check if all values in array are equal 
Php :: How to calculate the sum of values in a list PHP 
Php :: location php ini mac os 
Php :: carbon create from format 
Php :: variavel de variavel php 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =