This example below will check if a folder/directory is existed or not by using PHP is_dir function, if not will create that folder/directory by using PHP mkdir function
[php] <?php
$ABSPATH = dirname(__FILE__) . ‘/’;
$folder_name = "your-new-folder";
$new_folder_path = $ABSPATH . $folder_name;
if(!is_dir($new_folder_path))
{
mkdir($new_folder_path);
echo "The directory " . $folder_name . " was successfully created.";
}
else
{
echo "The directory " . $folder_name . " was existed.";
}
?>
[/php]
Note: the mode is 0777 by default, which means the widest possible access. mode is ignored on Windows