Tuesday 26 November 2019

php - Parse error: syntax error, unexpected T_ELSEIF

Doing some very basic coding on codeacademy and this has been bugging me for over an hour now.
What is possibly wrong with this code that it is displaying the error " Parse error: syntax error, unexpected T_ELSEIF on line 12 "






Our Shop



$items = 10; // Set this to a number greater than 5!
if ($items > 5) {
echo "You get a 10% discount!"; }
else { echo "You get a 5% discount!";

} elseif ($items == 1) {
echo "Sorry, no discount!";
}


?>




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...