php case and condition code example
Example 1: php case switch
switch ($i) {
case 0:
echo "i ist gleich 0";
break;
case 1:
echo "i ist gleich 1";
break;
case 2:
echo "i ist gleich 2";
break;
}
Example 2: case statement in php
<?php
switch ($i) {
case "apple":
echo "i is apple";
break;
case "bar":
echo "i is bar";
break;
case "cake":
echo "i is cake";
break;
}
?>