note 61367 deleted from control-structures.switch by nlopess
| From: | nlopess@php.net | Date: | Wed, 01 Feb 2006 18:55:30 +0000 |
| Subject: | note 61367 deleted from control-structures.switch by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102831@lists.php.net to get a copy of this message | ||
Note Submitter: dkeith2099 at hotmail dot com
----
este codigo es para switch con case anidados
for($i=0;$i<=10;$i++){
switch($i){
case 1: case 2: case 3: echo "k1 = ".$i."<br>"; break;
case 4: case 5: case 6: echo "i2 = ".$i."<br>"; break;
case 7: case 8: case 9: echo "i3 = ".$i."<br>"; break;
}
}
resultado
k1 = 1
k1 = 2
k1 = 3
i2 = 4
i2 = 5
i2 = 6
i3 = 7
i3 = 8
i3 = 9