note 47853 deleted from class.dir by tomsommer
| From: | tomsommer@php.net | Date: | Thu, 02 Dec 2004 20:01:11 +0000 |
| Subject: | note 47853 deleted from class.dir by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81293@lists.php.net to get a copy of this message | ||
Note Submitter: dhaked at rockefeller dot edu
----
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;
}
?>