All On Your Own! PLS Help


#1

Hey, this is my code, but i got "Oops, try again. Make sure you have three case blocks!". Any help?

$myAge = 24;
switch ($myAge) {
case "24";
echo "I'm 24 years old :))),and I'm codding PHP Like a Champ";
break;
case "25";
echo "I will be 25 this fall";
break;
case "23";
echo "I was 23 alrdy";
break;
case "26";
echo "Still long way to go";
break;
default:
echo "I'm neiher 23, 24, 25, or 26";
}


#3

I have figure it out what is the problem, just changed ; with : after echo's.


#4

The numbers in the cases should not be strings but number literals.


#5

Tnx, i saw this too:(


#6

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