How can you check if a directory with a specific name exists in PHP?

To check if a directory with a specific name exists in PHP, you can use the `file_exists()` function along with the `is_dir()` function. First, use `file_exists()` to check if a file or directory exists with the given name, and then use `is_dir()` to specifically check if it is a directory.

$directoryName = "example_directory";

if (file_exists($directoryName) && is_dir($directoryName)) {
    echo "Directory '$directoryName' exists.";
} else {
    echo "Directory '$directoryName' does not exist.";
}