Rate this script:  I Love it  /   I Hate it

Reverse switch


Code


switch(true) {

   case $x == "hello":
      // $x is hello

   case is_numeric($x):
      // $x is a number

   case $x < 10:
      // $x is less than 10
}

 

 

 
Reverse switch scripts | Reverse switch snippet | Reverse switch example | Reverse switch tutorial | Reverse switch code