$path = JPATH_ROOT . '/myfile.txt'; if (JFile::exists($path)) { echo 'File exists'; } else { echo 'File does not exist'; }
$path = JPATH_ROOT . '/images/myimage.png'; if (JFile::exists($path)) { echo 'Image exists'; } else { echo 'Image does not exist'; }This function is part of the Joomla Platform package library.