Answers for "php when to use a switch statement"

PHP
1

switch case php

<?php

$fav_food = "burger";

switch($fav_food)
{
    case "pavbhaji":
        echo "My favourite food is pavbhaji";
        break;

    case "dhosa":
        echo "My favourite food is dhosa";
        break;

    case "dabeli":
        echo "My favourite food is dabeli";
        break;
    
    case "burger":
        echo "my favourite food is burger";
        break;

    default:
        echo "I am foody..";
        break;
}
?>
Posted by: Guest on September-06-2021

Code answers related to "php when to use a switch statement"

Browse Popular Code Answers by Language