Created
March 16, 2015 17:23
-
-
Save bgadrian/bbd6722890610ed56d3b to your computer and use it in GitHub Desktop.
Switch ranges true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//works in any language | |
switch(true) | |
{ | |
case ($i==6): | |
doSomething(); | |
break; | |
case ($i >= 8 && $i <= 17): | |
rangedData(); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment