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元