How can PHP be used to create directories with appropriate permissions?

To create directories with appropriate permissions using PHP, you can use the `mkdir` function along with `chmod` to set the desired permissions. First, create the directory using `mkdir` and then use `chmod` to set the permissions. Make sure to specify the correct permissions in numeric format, such as 0755 for read, write, and execute permissions for the owner, and read and execute permissions for others.

$directory = 'new_directory';
$permissions = 0755;

if (!file_exists($directory)) {
    mkdir($directory);
    chmod($directory, $permissions);
}