-
What will be the output of the following PHP code?
<?php
$State = "Chennai";
switch ($State) {
case "Mumbai":
echo "I love Mumbai. ";
case "Chennai":
echo "I love Chennai. ";
case "Rajshathan":
echo "I love Rajshatan. "; }
?>
-
- I love Chennai. I love Mumbai.
- I love Mumbai.
- Error
- I love Chennai. I love Rajshatan.
- None of these
Correct Option: D
If a break statement isn’t present, all subsequent case blocks will execute until a break statement is located.