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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]  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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to