| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
FileSystem |
JFile |
exists |
exists() |
Never | Work in Progress |
This function is a wrapper for the standard PHP file_exists function. If the file exists, the function returns true. Otherwise, it returns false.
boolean exists ( $file )
| $file | string | is a string that contains the file path that is to be checked. |
Example: This example checks if a file exists.
Example
if (JFile::exists( 'images/stories/clock.jpg' )) { echo "<h3>File exists!</h3>"; } else { echo "<h3>File does not exist!</h3>"; }