note 62852 deleted from function.mkdir by crell
| From: | crell@php.net | Date: | Wed, 29 Jun 2022 19:10:47 +0000 |
| Subject: | note 62852 deleted from function.mkdir by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218701@lists.php.net to get a copy of this message | ||
Note Submitter: Ali Baba
----
Greg, your code does not work for me; maybe it has a bug or we have configuration changes. Anyway,
this one works to create recursively the directory DIRECTORY.
<?
define ("DIRECTORY", "/tmp/mydir/mysubdir");
do {
$dir = DIRECTORY;
while (!is_dir($dir)) {
$basedir = dirname($dir);
if ($basedir == '/' || is_dir($basedir))
mkdir($dir,0777);
else
$dir=$basedir;
}
} while ($dir != DIRECTORY);
?>