The is_file() function checks whether the specified file is a regular file.
If the file is a regular file, this function returns TRUE.
is_file(file)
parameter | describe |
---|---|
file | Required. Specifies the documents to be checked. |
Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.
<?php$file = "test.txt";if(is_file($file)) { echo ("$file is a regular file"); }else { echo ("$file is not a regular file"); } ?>
The above code will output:
test.txt is a regular file