Op woensdag 14 augustus 2002 20:00, schreef Harry.de:
> does anybody now a way in php to read out,
> how many files are in a directory

<?php
// Note that !== did not exist until 4.0.0-RC2
clearstatcache();
$dir='/home/';
if ($handle = opendir($dir))
{
    echo "Directory handle: $handle\n";
    $counter=0;
    while (false !== ($file = readdir($handle)))
    {
          if(is_file($dir.'/'.$file))$counter++;
    }
}

echo  $counter."\n";
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to