RE: [PHP] if test
| From: | Chris | Date: | Tue, 19 Jun 2007 13:55:10 +0000 |
| Subject: | RE: [PHP] if test | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257406@lists.php.net to get a copy of this message | ||
I am not sure what you are trying to accomplish, but maybe require( some
file ) will be of more use to you.
-----Original Message-----
From: Kostas Papadimitriou [mailto:vinilios@gmail.com]
Sent: Tuesday, June 19, 2007 9:31 AM
To: php-general@lists.php.net
Subject: Re: [PHP] if test
Jochem Maas wrote:
> please keep posts on list.
>
> jekillen wrote:
>> On Jun 17, 2007, at 12:18 PM, Jochem Maas wrote:
>>
>>> jekillen wrote:
>>>> Hello again;
>>>> does the following test pass if the file is successfully included:
>>>> if( include( some file ) )
>>>>
>>>> or does it pass with:
>>>> if( ! include( some file ) )
>>> have you tried it?
>>>
>>>
>> Well, typically while waiting for a reply, which I thank you for,
>> I did browse through My Oreilly text Programming php
>> which did not have anything definitive, and looking at
>> the manual which did not have anything completely
>> satisfying, I did try it as if( include( some file ) ) and
>> it worked. But I also testing a file that I knew would
>> cause an error, sure enough the else conditional
>> did smear error messages all over the browser window.
>
> I have no idea what else condition you mean and I also have no idea
> what these 'error messages' are or what they have to do with the
> original question (which I had assumed was about the testing return
> values from an include statement ... something you could have gleaned
> from the manual and a couple of tests.
>
>
>> So I did:
>> if(file_exists( some file ))
>> {
>> include(some file);
>> }
>> Thanks again
>> JK
>>
Im not exactly sure either about what you mean but you could give it a
try using try {} catch {}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php