Emanuil Rusev Emanuil Rusev - 11 months ago 85
PHP Question

How to include only if file exists

I need an

function / statement that will include a file only if it exists. Is there one in PHP?

You might suggest using
but there is an issue with that approach - in case the file to be included exists, PHP will not output warnings if the parser find something wrong in the included file.

    include 'file.php';

That should do what you want