Posted under » PHP updated on 17 Feb 2022
Normally we use the if statements but sometimes we use the Case statements.
$hai = 1; switch ($hai) { case 1: $hoi = "Prof"; break; case 2: $hoi = "A/Prof"; break; case 3: $hoi = "Dr"; break; case 4: $hoi = "Mr"; break; case 5: $hoi = "Ms"; break; case 6: $hoi = "Miss"; break; case 7: $hoi = "Mrs"; break; default: $hoi = "Gayyyy"; }