note 37544 modified in function.include by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 01:07:35 +0000 |
| Subject: | note 37544 modified in function.include by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155483@lists.php.net to get a copy of this message | ||
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";
?>
--was--
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:
// 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";
http://php.net/manual/en/function.include.php