How can one create a folder using PHP?

To create a folder using PHP, you can use the `mkdir()` function. This function takes two parameters: the path of the directory to create and optional flags to set permissions and recursive behavior. Make sure the directory path is writable by the PHP process.

<?php
$folderPath = 'path/to/new/folder';
if (!file_exists($folderPath)) {
    mkdir($folderPath, 0777, true);
    echo 'Folder created successfully.';
} else {
    echo 'Folder already exists.';
}
?>