welcomewiki has just posted in the PHP Forum forum of Wiki Newforum under the title of PHP Switch Statement.
This thread is located at http://www.wikinewforum.com/showthread.php?t=5855
Here is the message that has just been posted:
***************
*Example*
This is how it works:
* A single expression (most often a variable) is evaluated once
* The value of the expression is compared with the values for each case in the structure
* If there is a match, the code associated with that case is executed
* After a code is executed, *break *is used to stop the code from running into the next case
* The default statement is used if none of the cases are true
<html>
<body> <?php
switch ($x)
{
case 1:
echo "Number 1";
break;
case 2:
echo "Number 2";
break;
case 3:
echo "Number 3";
break;
default:
echo "No number between 1 and 3";
}
?> </body>
</html>
***************