note 80553 deleted from function.mkdir by crell
| From: | crell@php.net | Date: | Wed, 29 Jun 2022 19:18:51 +0000 |
| Subject: | note 80553 deleted from function.mkdir by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218718@lists.php.net to get a copy of this message | ||
Note Submitter: david dot NOSPAM at ajnewmedia dot NOSPAM dot co dot uk
----
p-garcia : since PHP 5, setting the recursive flag (which currently has no notes in the manual
entry) will allow you to create nested directories in the same way as Windows / Linux mkdir -p, so
long as the webserver has permissions to write in the root directory of the path specified
eg:
<?php
mkdir ("./newdir1/newdir2/newdir3/", 0755, true);
// Returns TRUE if you have permission to write to the current directory
// and creates nested directories with permissionsrwxr-xr-x
?>