Home > php教程 > php手册 > F 快速缓存改造版

F 快速缓存改造版

WBOY
Release: 2016-06-07 11:45:53
Original
1734 people have browsed it

function F($name, $value='', $path = DATA_PATH) {<br>     $filename = $path . $name . '.php';<br> <br>     switch ($value){<br>         case ''        : goto read;<br>         case NULL    : return unlink($filename);<br>         default        : <br>             $dir = dirname($filename); is_dir($dir) or mkdir($dir,0755,true); <br>             return file_put_contents($filename, json_encode($value));<br>     }<br> <br>     read:<br>     if (is_file($filename)) {<br>         return json_decode(file_get_contents($filename), true);<br>     } else {<br>         return false;<br>     }<br> }PHP 5.3+有效

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template