创建文件函数

 function create_file($file_path,$file_name,$result=array()) {
if(!is_dir($file_path)) mkdir($file_path,0777);
$handle = @fopen($file_path.$file_name, 'w');
$content="<?php\n\nreturn " . var_export($result, true) . ";\n\n?>";
@fwrite($handle, $content);
fclose($handle);
}
posted @ 2017-11-14 16:55  YeungKey  阅读(127)  评论(0)    收藏  举报