This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Control Flow: Switch Forum

View Course

37 points
55f64229937676c2ca000830_729530668
Submitted by
Nicky
over 1 year ago

Can't Save & Submit

My below code is working but every time I try to save & submit code I am told "Oops, try again. Make sure you have three case blocks!". What is causing the failure?

<?php
$test = "slideshow";
switch ($test) {
case "slideshow":
echo "slideshow header";
break;
case "featured":
echo "featured header";
break;
case "short";
echo "short header";
break;
default:
echo "no header set";
}
?>


0 votes

permalink

solved it typo in case - should have been:
case "short": not case "short";

37 points
55f64229937676c2ca000830_729530668
Submitted by
Nicky
over 1 year ago