Re: getting filenames from dir

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

 



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 the files in an array...
or use scandir() in PHP5 :-)

regards jesper

Merlin wrote:

Hi there,

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

Thanx,

Merlin



[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