复制代码 代码如下:
<?php //本功能主要是利用文件修改时间函数filemtime与现在时间作减法判断是否更新内容。 $cahetime=2;//设置过期时间 $cahefile="cahe.txt";//读写文本 if(file_exists($cahefile) && time()-$cahetime< filemtime($cahefile)){ echo file_get_contents($cahefile); } else { file_put_contents($cahefile,date("y-m-d H:i:s",time())); } ?>
查看更多关于本功能主要是利用文件修改时间函数filemtime与现的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did7354