How to include a file only if the file exists in PHP? April 27, 2023 by Tarik if(file_exists('file.php')) include 'file.php'; That should do what you want