note 11666 added to elseif
| From: | bmpc at netcabo dot pt | Date: | Thu, 01 Mar 2001 17:40:35 +0000 |
| Subject: | note 11666 added to elseif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11721@lists.php.net to get a copy of this message | ||
Well, here is a litle example of how you can use elseif..
$color = "red";
$ocolor = $color;
if ( $color == "red" OR $color == "blue" ){
$color = "green";
}
elseif ( $color == "green" OR $color == "blue"){
$color = "red";
}
else {
$color = "blue";
}
echo "old color: $ocolor";
echo "<br><br>";
echo "new color: $color";
http://www.php.net/manual/en/control-structures.elseif.php