The What
Syntax
switch ( mixed $var ) { case mixed $value1: // do stuff break; case mixed $value2: // do stuff break; default: // do stuff } );
Description
This construct works similar to an if statement, where a value is compared to some condition. The case statements are the individual conditional comparisons, similar to the else if. The default works like an else where if none of the other conditions are true, then it will execute.
Parameters
var- Variable to be evaluated and then compared to each
case. value1- Value to compare the
$varto, which can be a literal, variable, or expression.
Return Values
Returns the number of times the event fired.
Hands off the keyboard. Web development starts by thinking first, then planning it out, and then coding it.
More coming soon…keep checking back.
