Problem: How to use a switch case ‘or’ in PHP?
Solution: This can be achieved in 2 ways. They are as follows:
Method 1: Without using break keyword in one of the switch case.
The option is either 1 or 2.
Method 2: Using or operator in switch case.
The option is either 1 or 2
- Menu-Driven program using Switch-case in C
- Nested switch case
- Switch case in R
- Golang Program to Show the Duplicate Case Error in Switch Statement
- Switch Case with Break in For Loop in Golang
- Scala | Case Class and Case Object
- PHP | Check if all characters are lower case
- Nested switch statement in C++
- Golang Program that uses String Switch
- What is ISL(Inter-Switch Link)?
- Golang Program that switch on floating-point numbers
- Golang program that uses switch, multiple value cases
- What is SMPS(Switch Mode Power Supply)?
- Decision Making in R Programming - if, if-else, if-else-if ladder, nested if-else, and switch
- What is the use of the @ symbol in PHP?
- What is the use of “=>” symbol in PHP ?
- When to use static vs instantiated classes in PHP?
- How to use bcrypt for hashing passwords in PHP?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.