06-13-2011, 02:29 AM
I am getting an unexpected '}' error on line 21, but on line 21, I NEED that '}' to end the function! What should I do?
<?php
ini_set ('diplay_errors', 1); //set the system to display errors. (SOOO USEFUL)
$num = rand(1,8); //assign the variable
//start the function, while using elseif to save space.
if ($num == 1) {
print "<p>You got number 1, DOES THAT MEAN YOU ARE?</p>";
} elseif ($num == 2) {
print "<p>Number 2, you got second my young student</p>";
} elseif ($num == 3) {
print "<p>Magic number, 3 is. -Master Yoda</p>";
} elseif ($num == 4) {
print "<p>4, or for. You decide.</p>";
} elseif ($num == 5) {
print "<p>You has 5 fingers. OR DO YOU?</p>";
} elseif ($num == 6) {
print "<p>6? 666? Oh dear lord what have I done? O_O</p>";
} elseif ($num == 7) {
print "<p>7! You lucky boy! Or girl, how the hell should I know?</p>";
} else ($num == 8) {
print "<p>You got 8! You win the prize! Call 1-800-YOU-FAIL for your FREE prize!</p>";
}
?>
<?php
ini_set ('diplay_errors', 1); //set the system to display errors. (SOOO USEFUL)
$num = rand(1,8); //assign the variable
//start the function, while using elseif to save space.
if ($num == 1) {
print "<p>You got number 1, DOES THAT MEAN YOU ARE?</p>";
} elseif ($num == 2) {
print "<p>Number 2, you got second my young student</p>";
} elseif ($num == 3) {
print "<p>Magic number, 3 is. -Master Yoda</p>";
} elseif ($num == 4) {
print "<p>4, or for. You decide.</p>";
} elseif ($num == 5) {
print "<p>You has 5 fingers. OR DO YOU?</p>";
} elseif ($num == 6) {
print "<p>6? 666? Oh dear lord what have I done? O_O</p>";
} elseif ($num == 7) {
print "<p>7! You lucky boy! Or girl, how the hell should I know?</p>";
} else ($num == 8) {
print "<p>You got 8! You win the prize! Call 1-800-YOU-FAIL for your FREE prize!</p>";
}
?>