Forum Moderators: coopster
Here is the main bit of the problem code - it reads the contents of four directories (controlled by $section) into a multi-dimensional array (at least it is supposed to)...
if (is_dir($dir))
{
// can it be opened?
if ($dh = opendir ($dir))
{
// don't load any file beginning with '.'
while (false!== ($file = readdir ($dh)))
{
if (strpos ($file,'.')>0)
{
// get the last modified time
$LastModified =date ("ymdHis", filemtime($file));
// debug line
echo "section = $section: file = $file :last mod = $LastModified <br />";
// if there is a mod time then store this
if ($LastModified)
{
$files [$section][$LastModified] = array ($file);
// sort these by last modified
ksort ($files [$section]);
}
}
}
// close the file
closedir ($dh);
}
it returns with every file last mod= 700101010000
I have tried fileatime, mtime and ctime - with the same result.
Hope someone can help.
Many, many thanks.