Posted by Smitro on 09/16/05 12:30
Cylindric wrote:
> Smitro wrote:
>
>>Hi,
>>
>>How come in some statements I can use:
>>
>>If (something) or DIE();
>>
>>but other times it won't work (returns an error) unless I take out the
>>OR.
>>
>>Is there any documentation on this anywhere?
>
>
> Think of it from a conversational point of view:
>
> PHP: "If (something) or DIE();"
> ENG: "If MyName=Fred Or Then DoSomething" makes no sense
>
> PHP: "If (something or somethingelse) Then Die();"
> ENG: "If MyName=Fred Or MyAge=92 Then DoSomething" makes sense
>
> PHP: "If (something) then DIE();"
> ENG: "If MyName=Fred Then DoSomething"
>
yep, got a point, I was trying to revese and if
statment, but then my other brain kicked in and
said, just stick some more brackets around it.
eg.
If ((something) and (something else)) or Die();
is now...
If (!((something) and (something else))) die();
[Back to original message]
|