Checks whether a path points to a directory.
The is_dir() function returns TRUE if a specified path is a directory, and FALSE otherwise.
<?php
if (is_dir("log.txt")) {
print "log.txt is a directory<br>";
} else {
print "log.txt is not a directory<br>";
}
if (is_dir("backup")) {
print "backup is a directory";
} else {
print "backup is not a directory";
}
?> log.txt is not a directory
backup is a directory "backup" is a directory and "log.txt" is a file in the current directory.