Answers for "php mkdir()"

PHP
6

create folder php

// Create folder if not exist
		$folderName = 'images/gallery';
		$config['upload_path'] = $folderName;
		if(!is_dir($folderName))
		{
			mkdir($folderName, 0777);
		}
Posted by: Guest on August-26-2020
4

php mkdir

// Create a directory with the permission level (optional)
<?php
mkdir("/path/to/my/dir", 0700);
?>
Posted by: Guest on April-14-2020
2

php mkdir recursive

<?php
// Create a directory recursively (make sure to sanitize if taken from input as always!)
mkdir("/path/to/my/dir", 0777, true);
Posted by: Guest on June-30-2020
0

php mkdir

<?php
// Desired directory structure
$structure = './depth1/depth2/depth3/';

// To create the nested structure, the $recursive parameter 
// to mkdir() must be specified.

if (!mkdir($structure, 0777, true)) {
    die('Failed to create directories...');
}

// ...
?>
Posted by: Guest on September-04-2021

Browse Popular Code Answers by Language