PHP mkdir recursive with parents
Recursively create directories in PHP with mkdir()
.
$ mkdir --parents
function mkdir_p($directory, $mode=0700) {
$recursive = TRUE;
return @mkdir($directory, $mode, $recursive);
}
Note the @ is to ignore any existing folder.
1 comment
what about:
mkdir($_SERVER['DOCUMENT_ROOT'] . _PATH . '/' . $directory, 777, true);
Leave a Reply