Copy CodeThe code is as follows:
function Createhashdir ($sign)
{
$MD 5 = MD5 ($sign);
if (!is_dir (Mb_cache)) mkdir (Mb_cache);
for ($i =1; $i <=4; $i + +)
{
$dir. = $md 5{$i}. ' /';
if (!is_dir (Mb_cache. $dir))
{
mkdir (Mb_cache. $dir);
}
}
return Mb_cache. $dir;
}
function Setcachefile ($data, $sign = ' a ', $type = ' array ', $id = ')
{
$cacheDir = $this-Createhashdir ($sign);
if (!empty ($data))
{
$id = $id? $id: $sign;
$cacheFile = $cacheDir. $id. PHP ';
$content = $type = = ' array '? Var_export ($data, true): $data;
File_put_contents ($cacheFile, ' ');
}
}
function Getcachefile ($sign = ' a ', $id = ')
{
$cacheDir = $this-Createhashdir ($sign);
$id = $id? $id: $sign;
$cacheFile = $cacheDir. $id. PHP ';
if (Is_file ($cacheFile) && include_once ($cacheFile))
{
return $ $sign;
}
}
function Getcachefilepath ($sign = ' a ', $id = ')
{
$cacheDir = $this-Createhashdir ($sign);
$id = $id? $id: $sign;
Return $cacheDir. $id. PHP ';
}
function Delcachefile ($sign = ' a ')
{
$cacheDir = $this-Createhashdir ($sign);
$id = $id? $id: $sign;
$cacheFile = $cacheDir. $id. PHP ';
$this-Del_file ($cacheFile);
}
The above describes the PFSVODDATA.BBV is what file PHP file cache functions, including the PFSVODDATA.BBV is what the content of the file, I hope that the PHP tutorial interested in a friend to help.