excii
asked on
LISTING FILES FROM DIRECTORY, SORT BY DATE
I have listed files and directories with this script:
$dir = 'folder1';
if ($dhandle = opendir($dir))
{
while (false !== ($file = readdir($dhandle)))
{
if (is_file("$dir/$file"))
{
echo "FILE: " . $file . "<BR>";
}
else
{
if($file != "." && $file != "..")
{
echo "DIR: " . $file . "<BR>";
}
}
}
closedir($dhandle);
}
1. But how do I print CreatedDate and ModifiedDate to files & folders?
2. And how do I sort files & folders by CreatedDate or ModifiedDate ?
3. Is somewhere list of functions for all file's 'attributes' like Size, Type, CreatedDate, ModifiedDate, Attributes etc.
Thanks.
Regards,
excii
$dir = 'folder1';
if ($dhandle = opendir($dir))
{
while (false !== ($file = readdir($dhandle)))
{
if (is_file("$dir/$file"))
{
echo "FILE: " . $file . "<BR>";
}
else
{
if($file != "." && $file != "..")
{
echo "DIR: " . $file . "<BR>";
}
}
}
closedir($dhandle);
}
1. But how do I print CreatedDate and ModifiedDate to files & folders?
2. And how do I sort files & folders by CreatedDate or ModifiedDate ?
3. Is somewhere list of functions for all file's 'attributes' like Size, Type, CreatedDate, ModifiedDate, Attributes etc.
Thanks.
Regards,
excii
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that worked
so please tell us your platform and the filesystem of your volumes if on Windows :D