note 27446 added to function.file
| From: | akaylaa at yahoo dot com | Date: | Fri, 06 Dec 2002 05:01:32 +0000 |
| Subject: | note 27446 added to function.file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40404@lists.php.net to get a copy of this message | ||
a quick way to count the number of lines in a file is
$lines = file ('filename');
$num_lines = count ($lines);
echo ("Total lines in file: " . $num_lines);
--
http://www.php.net/manual/en/function.file.php
http://master.php.net/manage/user-notes.php?action=edit+27446
http://master.php.net/manage/user-notes.php?action=delete+27446
http://master.php.net/manage/user-notes.php?action=reject+27446