How can a folder be created on a web server using PHP?

To create a folder on a web server using PHP, you can use the `mkdir()` function. This function takes the directory path as the first parameter and an optional permissions mode as the second parameter. Make sure the directory path is writable by the web server. Here is an example code snippet to create a folder named "new_folder" in the root directory of the web server:

<?php
$folderPath = $_SERVER['DOCUMENT_ROOT'] . '/new_folder';
if (!file_exists($folderPath)) {
    mkdir($folderPath, 0777, true);
    echo "Folder created successfully.";
} else {
    echo "Folder already exists.";
}
?>