php中书写一个创建多久目录的函数

来源:互联网 发布:山东服务器数据恢复 编辑:程序博客网 时间:2024/05/19 10:07
header('content-type:text/html;charset=utf-8');
function createdir($path,$mode=0777){
//判断文件目录是否存在
if(is_dir($path)){
echo '目录:'.$path;
}else{
//不存在创建
$dir=mkdir($path,$mode,true);
if ($dir) {
echo '创建成功';
}else{
echo '创建失败';
}
}
}
$path='./depth1/depth2/depth3/';
createdir($path);
1 0
原创粉丝点击