首頁  >  文章  >  後端開發  >  php使用递归创建多级目录,php递归_PHP教程

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

WBOY
WBOY原創
2016-07-12 09:08:34762瀏覽

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