Re: getting filenames from dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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<br>";
   $myarray[]=$file;
}


Mario

Merlin wrote:

Hi there,

does anybody know how to get all file names from a specified directory into an array?

Thanx,

Merlin


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux