it is nearly the same as u know that from other scriptlaguages to understand it a bit more have a look at the switch case functions on php which u can find here http://php.net/manual/en/control-structures.switch.php at the end it is very simple and in many cases a good replacement for if ifelse else