For instances, we have single expression (a variable), that is evaluated once. Then, the value of expression compared with the values for each case in the structure. If there is a match, the block of code associated with that case is executed. And dont forget to use break to prevent the code from running into the next case automatically. The default statement is used if no match is found. Try this one:
Saturday, March 20, 2010
PHP - Switch Statement
Switch is a conditional statement to perform different actions based on different conditions.
For instances, we have single expression (a variable), that is evaluated once. Then, the value of expression compared with the values for each case in the structure. If there is a match, the block of code associated with that case is executed. And dont forget to use break to prevent the code from running into the next case automatically. The default statement is used if no match is found. Try this one:
For instances, we have single expression (a variable), that is evaluated once. Then, the value of expression compared with the values for each case in the structure. If there is a match, the block of code associated with that case is executed. And dont forget to use break to prevent the code from running into the next case automatically. The default statement is used if no match is found. Try this one:
.jpg)


0 comments:
Post a Comment