Emanuil Rusev Emanuil Rusev - 1 year ago 153
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.

Answer Source
    include 'file.php';

That should do what you want

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download