note 47853 added to class.dir
| From: | dhakedatrockefellerdotedu at osu1 dot php dot net | Date: | Thu, 02 Dec 2004 19:44:18 +0000 |
| Subject: | note 47853 added to class.dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81290@lists.php.net to get a copy of this message | ||
Here is an other way of counting number of files in a directory.
<?php
function get_number_of_files($dir)
{
$handle = opendir($dir) or die($php_errormsg);
$counter = 0;
while (false !== ($f = readdir($handle)))
{
$counter++;
}
closedir($handle);
return $counter;
}
?>
----
Manual Page -- http://www.php.net/manual/en/class.dir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47853
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47853&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47853&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47853&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47853&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47853&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47853&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47853&report=yes
Search -- http://master.php.net/manage/user-notes.php