小编Rid*_*thi的帖子

通过touch()更改文件的上次修改时间,并使用filemtime()获取结果

所以我试图获取文件的最后修改日期,然后将其更新到当前时间,但是当我查看结果时,我在$ oldtime和$ newtime中获得了SAME时间戳

$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));
Run Code Online (Sandbox Code Playgroud)

php caching

7
推荐指数
1
解决办法
4235
查看次数

标签 统计

caching ×1

php ×1