Re: Question
| From: | Stephen Edmonds | Date: | Tue, 22 Oct 2002 15:17:26 +0000 |
| Subject: | Re: Question | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16475@lists.php.net to get a copy of this message | ||
IF ( $Cheese == "yellow" && $Smell == "smelly " ) {
print "Eat the cheese!";
}
As you can see, you can link two IFs using && - which means if A and if B
You can also use for or || - if a OR if B
IF ( $Cheese == "yellow" || $Cheese == "Blue" ) {
print "Eat the cheese!";
}
Finally, you can use ELSEIF...
IF ( $Cheese == "yellow" ) {
print "Eat the cheese!";
}
ELSEIF ( $Cheese == "green" ) {
print "Green Cheese? I don't think so!";
}
ELSE {
print "I don't eat $Cheese coloured cheese";
}
I hope this makes things simple
Stephen
----- Original Message -----
From: "James Meers" <jambo@venda.com>
To: <php-windows@lists.php.net>
Sent: Tuesday, October 22, 2002 3:57 PM
Subject: [PHP-WIN] Question
> Thanks for the help with my previopus query, i havea new question now!
>
> How can i do an IF statement with multiple values? e.g.:
>
> if (isset($id)) {
>
> if (isset($email)) {
>
> blah
>
> } else {}
>
> }else {}
>
> can i use it within the same if?
>
> if (isset($id and $email)) {
>
> }else{
>
> }
>
> ????????????????????????????
>
> Cheers
>
> James
>
>
>
>