Mega Code Archive

 
Categories / Php / Code Snippets
 

Count the number of lines in a text file

<? php $file = "somefile.txt"; $lines = count(file($file)); echo "There are $lines lines in $file"; ?>