把表记录生成数组
By admin
- One minute read - 85 words以下是来自phpcms2008程序global.func.php文件部分函数,仅供参考:
function cache_read($file, $path = ”, $iscachevar = 0)
{
if(!$path) $path = CACHE_PATH;
$cachefile = $path.$file;
if($iscachevar)
{
global $TEMP;
$key = ‘cache_’.substr($file, 0, -4);
return isset($TEMP[$key]) ? $TEMP[$key] : $TEMP[$key] = @include $cachefile;
}
return @include $cachefile;
}
function cache_write($file, $array, $path = ”)
{
if(!is_array($array)) return false;
$array = “”;
$cachefile = ($path ? $path : CACHE_PATH).$file;
$strlen = file\_put\_contents($cachefile, $array);
@chmod($cachefile, 0777);
return $strlen;
}
function cache_delete($file, $path = ”)
{
$cachefile = ($path ? $path : CACHE_PATH).$file;
return @unlink($cachefile);
}