[thelist] one-line suppress PHP warnings?

Stephen Rider evolt_org at striderweb.com
Tue Mar 25 20:40:21 CDT 2008


On Mar 25, 2008, at 6:34 PM, kasimir-k wrote:
> Stephen Rider scribeva in 2008-03-25 22:46:
>> Is there a way to write the include so that if the file is _not_  
>> found
>> it will NOT write an error to the logs?
>>
>> I was doing a file_exists(), but I'm trying to streamline as much as
>> possible -- this would reduce three lines to one.
>
> But if you really want to do it, I can come up with two ways.
>
> 1. @include($incfile);
> You won't get any errors from the $incfile either - which may not be
> what you'd want.

THAT'S the thing that was tickling my brain.  I knew there was  
something like that but didn't know what to look for.  I didn't know  
that it excluded the entire included file from errors, but actually  
that is not a problem in this particular case. :)

That's what I was looking for.

Paul -- You script is a very clean version of what I was using  
previously.

Thanks to all.

Stephen

-- 
Stephen Rider
<http://striderweb.com/>






More information about the thelist mailing list