Return to Snippet

Revision: 23716
at February 11, 2010 16:36 by AzizLight


Initial Code
/**
 * 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

Initial URL


Initial Description


Initial Title
Count the number of lines in a file

Initial Tags


Initial Language
PHP