Learn Before
Concept

PHP - The switch Statement

To run one statement under various conditions, use the Switch statement in PHP. Similar to PHP's if-else-if statement, it operates.

<?php switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; case label3: code to be executed if n=label3; break; ... default: code to be executed if n is different from all labels; } ?>

0

2

Updated 2023-11-05

References


Tags

Object-Oriented Programming (OOP) Languages

Object-Oriented Programming

Programming Language Paradigms

General programming languages

Computing Sciences

Learn After