note 106365 deleted from function.include by danbrown
| From: | danbrown@php.net | Date: | Mon, 31 Oct 2011 15:12:28 +0000 |
| Subject: | note 106365 deleted from function.include by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184254@lists.php.net to get a copy of this message | ||
Note Submitter: Darren Zoidberg
----
Howdy guys, just a quick one. While trying to report a custom result of a require()... I found this
as the most practical method.
The @ suspends the errors message, and allows me to command the script to die, when i choose.
$report[0] = @include('php/file_was_found.html'); // RETURNS : int(1)
$report[1] = @include('php/file_not_found.html'); // RETURNS : bool(false)
Remember that the code above, DOES perform the include if the file is available.