<p class="sycode"> </p> <pre name="code" class="sycode">$str = '<?php return '."\n".var_export($data,true).';?>';$filename = 文件所在路径;$fp=fopen("$filename", "w+"); //打开文件指针,创建文件if(!is_writable($filename)){ die("文件:" .$filename. "不可写,请检查!");}file_put_contents($filename,$str);</pre> <br>