Control Flow: Switch 6/6

All On Your Own!
It's time to show what you have learned aboutswitches so far!
Instructions
Create a switch statement with 3 differentcases and a default case if you wish. Feel free to use the alternative syntax as well!
?
Hint
Test how well you're learning and fill in gaps with Codecademy Pro.Learn more.
Feel free to check back to the previous exercises, but here's a small reminder:
switch (X) {
    case X:

        break;
    default:

}
Control Flow: Switch 6/6
<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body>
    <?php
    $i = 5;

    switch ($i) :
        case 0:
            echo '$i is 0.';
            break;
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
            echo '$i is somewhere between 1 and 5.';
            break;
        case 6:
        case 7:
            echo '$i is either 6 or 7.';
            break;
        default:
            echo "I don't know how much \$i is.";
            break;
    endswitch;
    ?>
    </body>
</html>

Comments

Popular posts from this blog

MEGA 暫存檔案刪除

IOS GCD多執行緒

利用CMD指令強制刪除