So, I'm trying to get the date the file was last modified, and then update it to the current time, but when I look at the result, I get a SAME timestamp in both $ oldtime and $ newtime
$file = 'test.txt'; $oldtime = filemtime($file); touch($file, time()); $newtime = filemtime($file); echo '<h1>old</h1>'; print_r(getdate($oldtime)); echo '<h1>new</h1>'; print_r(getdate($newtime));
source share