首頁  >  文章  >  後端開發  >  photoshop cs5 官方中文破解版下載 php 快取函數代碼

photoshop cs5 官方中文破解版下載 php 快取函數代碼

WBOY
WBOY原創
2016-07-29 08:38:411812瀏覽

複製程式碼 程式碼如下:


**
* @說明: 檔案快取輸出
* @參數: $cacheache => cache檔案(絕對路徑)
* @參數: $pertime => 快取輸出的間隔時間
* @參數: $sql => sql語句
* @參數: $templatefile => 範本文件名稱(絕對路徑)
* www.php100.com 來自
**/
function __cache($cachefile,$pertime,$sql,$templatefile) {
global $db;
if(time() - @filemtime($cachefile) >= $pertime) {
$query = $db->query($sql);
while($r=$db->fetch($query )) {
$cachelist[] = $r;
}
include $templatefile.'.php';
$cacheserialize = serialize($cachelist);
file_put_contents($cachefile, $cacheserialize);
}else{
$cachelist = unserialize(file_get_contents($cachefile));
include $templatefile.'.php';
}
}
}

} }

}

}

}

} } } 以上就介紹了photoshop cs5 官方中文破解版下載 php 快取函數程式碼,包含了photoshop cs5 官方中文破解版下載方面的內容,希望對PHP教學有興趣的朋友有所幫助。
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn