Only way to change modification date in catalogue is to create file in via touch() and dalete it with unlink():
<?php
$dir = 'temp';
$files1 = scandir($dir);
$files1 = array_slice($files1, 2);
foreach ($files1 as $key => $val)
{
if (!is_dir($val)) continue;
if (!touch($val))
{
touch($val . "/plik.txt");
unlink($val . "/plik.txt");
}
}
?>