ICC WORLD CUP 2011 WATCH LIVE ONLINE

Count the number of lines in a text file using PHP

2:48 PM Posted by: Isuru Jayathissa 0 comments

Extremely simple PHP sample to count and return the number of lines in a text file. The output can be customised to suit your own requirements.

= "somefile.txt";

$lines = count(file($file));

echo
"There are $lines lines in $file";

?>

No comments:

Post a Comment

 


2009 Isuru's Blog. All rights reserved.
.
For the more details..,
keijayathissa@gmail.com