php保存文件

function save($db)
{
    //转换合法数组
    $inputDb=var_export($db,TRUE);
    //组合写入字符串
    $inputStr=<<<str
<?php 
    return    $inputDb;
?>
str;
    //写入文件
    file_put_contents('db.php', $inputStr);
}

 

posted on 2015-04-22 11:36  wuye1200  阅读(94)  评论(0编辑  收藏  举报

导航