Determining if a Path is a File


You want to check if a file path is a file.


Use the File::isFile() method.

if (File::isFile($filename))
    echo "Yep. It's a file.";

If the file exists and is a regular file then true is returned. Otherwise false is returned.


This is a simple wrapper on the PHP is_file() function.

comments powered by Disqus