主要用到了两个函数var_export和file_put_contents.

1.var_export — 输出或返回一个变量的字符串表示

$v = var_export($a, TRUE); 
echo $v;

2.file_put_contents — 将一个字符串写入文件

int file_put_contents ( string filename, string data [, int flags [, resource context]] ) 

和依次调用 fopen(),fwrite() 以及 fclose() 功能一样。

echo file_put_contents('config.php', $title); 

发表评论