Re: Directory Listing in an Array
| From: | Dallas K. | Date: | Tue, 21 Aug 2001 06:27:50 +0000 |
| Subject: | Re: Directory Listing in an Array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63616@lists.php.net to get a copy of this message | ||
This is what I use
file://DIR to start looking in....
$basedir = "C:/Inetpub/wwwroot/_ActiveClientFiles/GLS/portfolio/";
file://working DIR or the dir to change to.
$wdir = "web/";
// list of DIRs var
$dirlist;
$filelist;
$add_dir ;
/***************************************************************************
***********************
// Load Online Directorys
****************************************************************************
**********************/
chdir($basedir . $wdir.'online/');
file://open the dir
$online=opendir(".");
while ($files = readdir($online))
{
if(is_dir($files) && ( $files !== "." && $files !== ".." ) )
{
$online_dir[$files] = $files; file://add files
}
}
if(count($online_dir)) file://sort
{ asort($online_dir);
}
rewinddir($online);
closedir($online);
?>
----- Original Message -----
From: "Chris Aitken" <chris@ideal.net.au>
To: <php-general@lists.php.net>
Cc: <support@ideal.net.au>
Sent: Monday, August 20, 2001 8:05 PM
Subject: [PHP] Directory Listing in an Array
> Hey all,
>
> Just something I havent been able to sort out in the archives, but what im
> wanting to do it this. Do a listing of all files in a directory, and load
> up an array with each returned filename.
>
> Am I pissing into a windy pipe dream or is there a simple solution for this ?
>
>
>
> Cheers
>
>
> Chris
>
>
> --
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: chris@ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
> __-----------------------------------------__
> *** Big Brother ***
> It just shows that the dull will rule the world. And we will be watching it.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>