Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199908

Re: [PHP3] getting all files in a directory From: Robert Aden (robert <email protected>)
Date: 08/16/99

function ShowDirectory($directory) {
  if(!isset($ret)) $ret = '';
  $dirhandle = opendir($directory);

  while ( $entity = readdir($dirhandle)) {
    if ($entity[0] == '.') {
      // Do nutting
    } elseif ( is_dir($directory . '/' . $entity)) {
      ShowDirectory($directory . '/' . $entity);
    } else {
      echo $directory . '/' . $entity . '=' . filesize($directory . '/'
. $entity) . '<br>';
    }
  }
}

Should work with some tweaking i guess.

//Robert

Citerar Dev Young <devon <email protected>>:

>
> I'm trying to write a script that can get all the files in a directory
&
> basically show their names & sizes, on a web page. Any ideas or
> suggestions on how to do this? I've been looking through the
filesystem
> functions...and can't figure out just what might work for this
>
> - Dev
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to
php3-unsubscribe <email protected>
> To subscribe to the digest, e-mail:
php3-digest-subscribe <email protected>
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail:
php-list-admin <email protected>
>
>

"Very funny, Scotty. Now beam down my clothes."

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>