PHP : Switch statement with multiple cases
In PHP programming, sometimes we encounter in a conditions which we have to make a switch statement with multiple case values.
Previously I was very confused how to make it, but after a bit of experimenting and googling anywhere, I finally find the way.
See the code below for more details:
| X | Y |
---------
| 1 | A |
| 2 | B |
| 3 | C |
| 4 | A |
| 5 | B |
<? # PHP : switch with multiple case # Author : adi@riswan.com echo "| X | Y | "; echo "--------- "; for ($x=1;$x<=5;$x++) { switch ($x) { case 1 : case 4 : $y = 'A'; break; case 2 : case 5 : $y = 'B'; break; case 3 : $y = 'C'; break; } echo "| $x | $y | "; } ?>and the result will be :
| X | Y |
---------
| 1 | A |
| 2 | B |
| 3 | C |
| 4 | A |
| 5 | B |
CasinoDaddy.com | Your Ultimate Guide to Online Gambling
ReplyDeleteCasinoDaddy.com is a site that 남원 출장샵 was developed by online 오산 출장샵 gambling company CasinoDaddy.com. It 서산 출장안마 is a 여수 출장샵 sister site to CasinoDaddy.com, 김포 출장안마 and they are licensed