You can use the is_dir("directory") function. A quick example:
if(is_dir("/home/mrmufin")) {
echo "Directory exists.";
} else {
echo "No directory.";
}
One caveat: the process owner under which the PHP script runs MUST be able to see the directory. For example, on my system the directory '/root/bin' DOES exist, but since the PHP interpreter runs within the webserver daemon, and the webserver is NOT allowed to view files within '/root/', the same example above will return false.