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

Control Flow: Switch Forum

View Course

226 points
8f5dca6bfa2af62bc12818a92f51fd33?s=140&d=retro
Submitted by
sainarayanan
over 1 year ago

1/6 what is the problem????????i'm not able to proceed!!!!!!!!!!!!!!!!!!!

<!DOCTYPE html>





<?php
$age = 19
if($age < 16){
echo "too bad";
}
else if($age < 19){
echo "careful";
}
else{
echo "accepted";
}
?>

what is wrong in this?????????????????


0 votes

permalink

you hav a space in elseif
your code hav to look like this
<?php
$age = 19
if($age < 16){
echo "too bad";
}
elseif($age < 19){ //-space in elseif
echo "careful";
}
else{
echo "accepted";
}
?>

202 points
592b78507c66468be795617cbf409fbe?s=140&d=retro
Submitted by
Kim Christensen Kjær
over 1 year ago


0 votes

permalink

Add your semi column after $age=19 (see below)
I use this online php. tester to see where the mistake is located,
http://phptester.net/

<?php
$age = 19;
if($age < 16){
echo "too bad";
}
else if($age < 19){
echo "careful";
}
else{
echo "accepted";
}
?>

241 points
F485e5508b8aeace2825940c746c1094?s=140&d=retro
Submitted by
stephoz
over 1 year ago