note 37544 deleted from function.include by googleguy
| From: | googleguy@php.net | Date: | Wed, 01 Aug 2012 07:05:09 +0000 |
| Subject: | note 37544 deleted from function.include by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189555@lists.php.net to get a copy of this message | ||
Note Submitter: php at mijav dot dk
----
The @ directive works with this construct as well. My experience is you can use an if-statement to
verify if the script was included (I havn't tested this on remote includes, there might be
non-standard-404 pages that makes it impossible to verify you got the right page)
Example:
<?php
// ignore the notice and evaluate the return value of the script, if any.
if(@include(dirname(__FILE__)."/foo.php"))
echo "foo.php included";
else
echo "failed to include foo.php";
?>