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