Answers for "php create dir if not exist"

PHP
1

linux php script create directory if doesn't exist

$path = "sample/path/newfolder";
if (!file_exists($path)) {
    mkdir($path, 0777, true);
}
Posted by: Guest on May-27-2021
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

Code answers related to "php create dir if not exist"

Browse Popular Code Answers by Language