PHP Switch Case Statement Syntax and Example

This statement is used if one needs to select one from multiple options. PHP Switch Case Syntax: switch (x) { case label1: code to be executed if x=label1; break; case label2: code to be executed if x=label2; break; case label3: code to be executed if x=label3; break; … default: code to be executed if x … Read more

Switch Statement in JavaScript

The switch statement performs different actions based on different condition. It can be called as the replacement of multiple nested if-else statements. The JavaScript Switch Statement The switch statement is used to select one of many code blocks to be executed. Switch case is useful for menu based application. Syntax switch(expression/variable) { case a: // … Read more