Check for the existence of a file and return simple boolean value or display an HTML snippet containing information about the file.
If a format string is not passed to it, the function if_file_exists() returns a simple boolean (true or false) indicating if the specified file exists.
Otherwise, the format string provided to it will be used to construct a response string, which can be customized to display information about the file (such as filename, fileurl, or file_path). If the $echo argument is true, that string is displayed on the page. Regardless of the value of $echo, the response string is returned by the function.
By default, the function assumes you are looking for the file in the default WordPress upload directory. If you wish to search another directory, specify it as the $dir argument and not as a path attached to the filename.




