I am having a hard time understanding the functionallity of the 'stat' command, and was hoping someone could help me out.
here's what I've got going right now.
<?php
$path = "c:\windows";
function getfolder($path) {
# the folder Path to check from.
# Initialise list arrays, directories and files separately and array counters for them
$d_arr = array(); $d = 0;
# Open possibly available directory
if( is_dir( $path ) ) {
if( $handle = opendir( $path ) ) {
while( false !== ( $file = readdir( $handle ) ) ) {
# Make sure we don't push parental directories or dotfiles (unix) into the arrays
if( $file != "." && $file != ".." && $file[0] != "." ) {
if( is_dir( $path . "/" . $file ) )
# Create array for directories
$d_arr[$d++] = $file;
}
}
}
}
# Wrap things up if we're in a directory
if( is_dir( $handle ) ) closedir( $handle );
# Sort and reset the arrays
asort( $d_arr ); reset( $d_arr );
# Print the directory list
for( $i=0; $i < count( $d_arr ); $i++ ) {
# Print with query string
print $i . " directory = " . $d_arr[$i] . "<br>";
}
}
getfolder($path);
?>
what I am looking to do produce an array with the following:
folder name (done), date last modified (need this part)
could someone possibly provide me with a mod to this allowing me to gather this information?
I am assuming it would go within this area of code.
if( is_dir( $path . "/" . $file ) )
# Create array for directories
$d_arr[$d++] = $file;