I need someone to tell me what is wrong with this code


#1


https://www.codecademy.com/courses/web-beginner-en-jZv2E/0/6?curriculum_id=5124ef4c78d510dd89003eb8


it is saying that i've not made three different cases


<?php
     $age=24;
     switch($age){
         case 1;
         case 2:
         case 3;
     echo"you are underage";
     break;
        case 24;
        case 27;
        case 23;
     echo"Forget it";
        break;
        case 25;
        case 28;
        case 18;
     echo "keep trying";
        break;    
     
     default;
        echo"Next";
     }
    ?>


#2

@combachico,
A case clause is ended with a colon-:
like

case 2:

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.