switch case php

Posted by w3diy - 2 months ago

PHP switch Statement

<?php
$favcolor = "red";

switch ($favcolor) {
  case "red":
    echo "Your Website color is red!";
    break;
  case "blue":
    echo "Your Website color is blue!";
    break;
  case "green":
    echo "Your Website color is green!";
    break;
  default:
    echo "Your Website color is neither red, blue, nor green!";
}
?>