摘要: <?function readsfile($path){ $dir=opendir($path); while ($file=readdir($dir)) { $filepath=$path."/".$file; if($file!="."&& $file!=".."){ if(is_dir($filepath)){ echo "<tr>"; echo "<td ><font color='red'>".$file.&qu 阅读全文
posted @ 2011-10-12 21:45 菜菜学习 阅读(327) 评论(0) 推荐(0)
摘要: 1 <?php 2 class time{ 3 private $startTime; 4 private $stopTime; 5 6 function __construct(){ 7 $this->startTime=0; 8 $this->stopTime=0; 9 }10 11 function start(){12 $this->startTime=microtime(true);13 14 }15 function stop(){16... 阅读全文
posted @ 2011-10-10 10:43 菜菜学习 阅读(343) 评论(0) 推荐(0)
摘要: <?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())); 阅读全文
posted @ 2011-09-29 23:20 菜菜学习 阅读(523) 评论(2) 推荐(0)