Powered by Blogger.

Count The Number of Lines

/**
* Count number of lines in a file.
*
* @access private
* @param string filepath : The name of the file
* @return int : The number of lines
*/
private function _count_lines($file)
{
$handle = fopen( $filepath, "r" );
$count = 0;
while(fgets($handle))
{
$count++;
}
fclose($handle);
return $count;
} // End of _count_lines

Bannerad

Artikel Terpopuler

Tags

Blogumulus by Roy Tanck and Amanda Fazani