How can you modify a PHP script to create a new folder in a different directory than where the script is located?

To create a new folder in a different directory than where the PHP script is located, you can specify the full path to the directory where you want the new folder to be created. This can be achieved by using the `mkdir()` function in PHP and providing the full path as the first argument.

<?php
$directory = '/path/to/your/directory/';
$folderName = 'new_folder';

if (!file_exists($directory . $folderName)) {
    mkdir($directory . $folderName);
    echo "Folder created successfully!";
} else {
    echo "Folder already exists!";
}
?>