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

Control Flow: Switch Forum

View Course » View Exercise

942 points
52547b35548c354a1500052d_183323904
Submitted by
Gavin Franklyn
almost 3 years ago

Why won't I pass?

** <?php
if (39> 10) {
echo "I am an idiot",
}elseif (1>9){
echo "Herpy Derpy"
}else {
echo "THE COMPUTER HAS SPOKEN"
}
?>** Pause error unexpected '}' on line 10 (The elseif part)


4 votes

permalink

THE SEMICOLONS AFTER THE SENTENCES DON'T FORGET IT,PLEASE!

1094 points
53cc1e7c7c82ca484000031d_554543193
Submitted by
Luis
almost 3 years ago


3 votes

permalink

YOU HAVE MISSED THE SEMI COLONS :3 AFTER EVERY ECHO

74 points
F650870849fbe2174057fea9807a34e7?s=140&d=retro
Submitted by
Sajjad Ali Anver
almost 3 years ago

1 Comment

5546eedc390fb11f2d498d38f21d12a4?s=140&d=retro etn almost 3 years ago

that too, so replace the comma with a semi colon, and add the other semi colons


0 votes

permalink

Can you post your code?

968 points
5296b33aabf821857b0015d6_980210769
Submitted by
turkey3
almost 3 years ago


0 votes

permalink

extra comma after echo "I am an idiot"
it expects you to put something after the comma before you close the block

1051 points
5546eedc390fb11f2d498d38f21d12a4?s=140&d=retro
Submitted by
etn
almost 3 years ago