![]() But what if you want to perform the same action, if the car input is either "Audi" or "Mercedes". In the code example above, we have specified a single condition, like if the car is " Audi" do this, and if the car is " Mercedes" do something else. Here is a simple example where we have used the switch statement in PHP to print something based on the choice of the car provided: For example, if the variable being evaluated is a string, the values in each case statement should also be strings.When we use a switch case in PHP, mostly the requirement is to evaluate a single condition in every case. The values in each case statement should also be of the same data type as the value of the variable or expression is evaluated. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |