RE: read file from specific line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Is there any way reading a file from a specific line? (textfile)
[/snip]

Yes. 

Loop through a count until you reach the line you want, then read....

while(!feof($myFile)){
	if("lineNumberIWant" >= $i){
		read line
		$i++;
	} else {
		do not read line
		$i++;
	}
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux