将指定目录生成一个php文件,运行生成的文件后还原目录结构-PHP源码
跳至
[1]
[全屏预览]
'file','path'=>$trimPath,'content'=>base64_encode(file_get_contents($file)));
}
else if(is_dir($file)){
$list[]=array('type'=>'dir','path'=>$trimPath);
$list=readFileFromDir($file,$trimDir,$list);
}
}
closedir($handle);
return $list;
}
if(isset($argv)){
$dir=$argv[1];
}
else{
$dir='.';
}
$list=readFileFromDir($dir,$dir);
$code=array();
$data=base64_encode(json_encode($list));
$code[]='';
$code=implode(PHP_EOL,$code);
$name=date('YmdHis').'.php';
file_put_contents($name,$code);
echo 'ok->'.$name;
?>
/php/3500.htmlwww.phpzy.comtrue/php/3500.htmlTechArticle将指定目录生成一个php文件,运行生成的文件后还原目录结构-PHP源码 跳至 [1] [全屏预览] 'file','path'=>$trimPath,'content'=>base64_encode(file_get_contents($file))); } else if(is_dir($file)){ $list[]=array('typ...
PHP之友评论