首页 >后端开发 >php教程 >php使用递归创建多级目录,php递归_PHP教程

php使用递归创建多级目录,php递归_PHP教程

WBOY
WBOY原创
2016-07-12 09:08:34803浏览

php使用递归创建多级目录,php递归

<?<span>php
</span><span>header</span>('Content-type:text/html;charset=utf8'<span>);
</span><span>echo</span> "Loading time:".<span>date</span>('Y-m-d H:i:s'<span>);
</span><span>sleep</span>(5<span>);
</span><span>echo</span> "<br>"<span>;
</span><span>echo</span> "End time:".<span>date</span>('Y-m-d H:i:s'<span>);
</span><span>//</span><span> 多级目录新建</span>
<span>function</span> createFolder(<span>$path</span><span>){
    </span><span>if</span>(!<span>file_exists</span>(<span>$path</span><span>)){
        createFolder(</span><span>dirname</span>(<span>$path</span><span>));
        </span><span>mkdir</span>(<span>$path</span>, 0777<span>);
    }
}

createFolder(</span>"/Library/WebServer/Documents/aa/bb/cc"<span>);
</span>?>

php使用递归创建多级目录

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1053803.htmlTechArticlephp使用递归创建多级目录,php递归 ? php header ('Content-type:text/html;charset=utf8' ); echo "Loading time:". date ('Y-m-d H:i:s' ); sleep (5 ); echo "br" ; echo "End...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn