Operations OR and || have different execution priorities. I'd prefer "||" as
it's "more important" so not so many parentheses needed to ensure the order
of interpretation is exactly what u need.

----- Original Message -----
From: "Tularis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 24, 2004 6:57 PM
Subject: [PHP] Re: If...Or...Else


> if(a OR b) {
>   do something
> } else {
>   do something else
> }
>
> or
>
> if(a || b) {
>   do something
> } else {
>   do something else
> }
>
> is enough :)
>
> Robb Kerr wrote:
> > From time to time I need an If statement that includes an Or
condition...
> >
> > <?php
> >   if ((condition1 == TRUE) OR (condition2 == TRUE)) {
> >     do something;
> >   } esle {
> >     do something else;
> >   }
> > ?>
> >
> > What's the correct syntax for the If line?
> >
> > Thanx
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to