On Wed, 13 Dec 2000 15:49, JCampbell wrote:
> Thank you all for your help earlier!
>
> Now I need to know if it is possible to create a complex if statement?
>
> if ($variable=="duck") || ($variable=="goose"){ }else{ }
>
> Is how I thought it would work. I just need to know if there is an easy
> way to do an OR in if statements IF variable equals duck or goose...
>
> <Jon>

Pretty much so; you might want to add extra parens thus:

if (($variable=="duck") || ($variable=="goose")){ }else{ }

You could, depending on exactly what you want, use a switch:
switch($variable){

case 'duck':
case 'goose':
 duck or goose action;
 break;
default:
 elephants, tigers etc action;
}

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to