Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP switch Statement

<?php
$favcolor = "red";

switch ($favcolor) {
  case "red":
    echo "Your favorite color is red!";
    break;
  case "blue":
    echo "Your favorite color is blue!";
    break;
  case "green":
    echo "Your favorite color is green!";
    break;
  default:
    echo "Your favorite color is neither red, blue, nor green!";
}
?>
 
PREVIOUS NEXT
Tagged: #PHP #switch #Statement
ADD COMMENT
Topic
Name
9+9 =