小编Gar*_*ary的帖子

Filemtime/cachetime我哪里错了?

我想要做的是检查一个图像的年龄,如果它超过60分钟,然后运行另一个PHP页面来获取图像,否则如果不到60分钟的时间什么都不做....

该脚本没有打开第二页(radartest.php)并运行它来更新图像,所以需要一个命令告诉它作为脚本运行.

<?php
$imagename='./radar/auck0.png';
$cachetime = 3600;
    //Start the caching of the images........
    if (file_exists($imagename) and filemtime($imagename) + $cachetime > time()) {
          echo("radartest.php");
        } else {
  null; //do nothing
}
?>
Run Code Online (Sandbox Code Playgroud)

php scripting image filemtime

2
推荐指数
1
解决办法
3170
查看次数

标签 统计

filemtime ×1

image ×1

php ×1

scripting ×1