--- title: Switch --- ## Switch In PHP, the `Switch` statement is very similar to the Javascript `Switch` statement (See the Javascript Switch Guide to compare and contrast). It allows rapid case testing with a lot of different possible conditions, the code is also more readable. ### Syntax ```php ``` ## Output ``` if case is 1 > Dice show number One. if case is 2 > Dice show number Two. if case is 3 > Dice show number Three or Four. if case is 4 > Dice show number Three or Four. if case is 5 > FiveSixDice show number Six. if case is 6 > SixDice show number Six. if none of the above > Dice show number unknown. ``` #### More Information: * [php.net docs Switch](https://secure.php.net/manual/en/control-structures.switch.php")