That should get you started :
$dirname='/var';
$dh=opendir($dirname) or die('could not open directory');
while (!(($file=readdir($dh))===false)){
if (is_dir('$dirname/$file')){
$myarray[]=$file;
}
echo "$file";
$myarray[]=$file;
}
Mario
Merlin wrote:
Hi there,
does anybody know h
And does one manage recursive sub directories for the same thing ?
On Apr 1, 2005 3:38 AM, Stanislav Kuhn <[EMAIL PROTECTED]> wrote:
> HI...
>
> Do you read php manual sometimes? ;o)
>
> just replace
> echo "$file\n";
> by
> $my_file_array[]=$file;
>
> readdir
> (PHP 3, PHP 4 , PHP 5)
>
> read
HI...
Do you read php manual sometimes? ;o)
just replace
echo "$file\n";
by
$my_file_array[]=$file;
readdir
(PHP 3, PHP 4 , PHP 5)
readdir -- read entry from directory handle
Description
string readdir ( resource dir_handle)
Returns the filename of the next file from the directory. The filen
Try this function:
function scandir($dirstr){
$files = array();
$fh = opendir($dirstr);
while (false !== ($filename = readdir($fh))){
array_push($files, $filename);}
closedir($fh);
return $files;
}
return an array with all th
4 matches
Mail list logo