Copy the Code code as follows:
**
* @ Description: File Cache output
* @ parameter: $cachefile ~ = cache file (absolute path)
* @ parameter: $pertime ~ = Interval between cache output
* @ parameter: $sql + = SQL statement
* @ parameter: $templatefile + = template file name (absolute path)
* Www.php100.com from
**/
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 ';
}
}
The above describes the Photoshop CS5 official Chinese cracked version download PHP cache function code, including the Photoshop CS5 the official Chinese version of the download of the content, I hope that the PHP tutorial interested in a friend helpful.