php 缓存设计
栏目:php教程时间:2014-04-04 23:29:58
- <?php
-
- $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()));
- }
- ?>
------分隔线----------------------------
------分隔线----------------------------