View Single Post
Old 05-25-2008, 08:43 PM   #1 (permalink)
Peuplarchie
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Application Array, add file info ...

Good day to you all,
I have a script here that read a directory and return the files to an array.
I need that array to also contain the last modified date, width, height and size of the files, they are images.


here's what I'm working with :

PHP Code:
 function dircont($imgdir)
 {
     
$dir_array = array();
     if (
false !== ($dir opendir($imgdir)))
     {
         while (
false !== ($file readdir($dir)))
         {
             if (
$file != '.' && $file != '..')
             {
                 
$dir_array[] = $file;
             }
         }
         return 
$dir_array;
     }
     else
     {
         return 
false;
     }
 }


 
// To print..
 // $path = "/home/helpelf/helpelf-www/";
 
echo "<pre>";
 
print_r(dircont($imgdir));
 echo 
"</pre>"
Thanks !
Take good care !
Peuplarchie is offline  
Reply With Quote