8月232014
php将数组缓存成文件
<?php //将数组保存为文件 - 用户读写配置项,保存配置文件 //本脚本自身要有写权限,生成目标文件要有读取和执行权限 echo '<pre>'; print_r($_SERVER); //这里使用SERVER代替配置数组 $code = var_export($_SERVER, true); $code = implode("\r", array('<?php', "return {$code};")); $code = str_replace(' ', "\t", $code); file_put_contents('conf.php', $code);
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!