note 48533 deleted from function.mkdir by tularis
| From: | tularis@php.net | Date: | Tue, 28 Dec 2004 20:10:39 +0000 |
| Subject: | note 48533 deleted from function.mkdir by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82416@lists.php.net to get a copy of this message | ||
Note Submitter: wouter at grep dot be
----
Creating a directory and its parents is obviously a /lot/ easier if you do it recursively...
<?
function mkDirR($dirname)
if(!file_exists($dirname)) {
mkDirR(dirname($dirname));
mkdir($dirname);
}
}
?>
No error checking done; but apart from that, this does exactly the same thing as that horribly long
mkDirE thingy ;-)
----
Reason: useless example