<html>
<head>
<title>Our Shop</title>
</head>
<body>
<p>
<?php
$items = 6; // Set this to a number greater than 5!
if ($items > 5) {
echo "You get a 10% discount!";
} else {
print "You get a 5% Discount";
}
?>
</p>
</body>
My Instructions:
Go ahead and add an elseif condition to your if/else. It should check whether $items == 1, and it should echo or print "Sorry, no discount!"
First off, please try to avoid using different fonts and sizes, it's just annoying to the eyes.
Also, when posting code, use the [ code ] tags. On this case, you can use [ code=php ] (without the spaces), like this:
<?php
$items = 6; // Set this to a number greater than 5!
if ($items > 5) {
echo "You get a 10% discount!";
} else {
print "You get a 5% Discount";
}
?>
Now, as for your question: You have an if/else statement and the instructions ask you to add an elseif statement. This is accomplished like this:
<?php
if (condition1)
{
command_to_run;
}
elseif(condition2)
{
command_to_run;
}
else
{
command_to_run;
}
?>
Does that answer your doubts?
EDIT: Damn, vezzy beat me to it.
@vezzy: Giving the answer right away won't help him fully understand, he may just copy-paste. Just my $0.02.