Answers for "php case stament"

PHP
2

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;
}
Posted by: Guest on February-03-2021
0

is switch case case sensitive in php

<?php
$smart = "cRikEy";

switch (strtolower($smart)) {
     case "crikey": // Note the lowercase chars
         echo "Crikey";
         break;
     case "hund":
         echo "Hund";
         break;
     case "kat":
         echo "Kat";
         break;
     default:
         echo "Alt Andet";
}
?>
Posted by: Guest on April-28-2021

Browse Popular Code Answers by Language