If..else problem



 $items = 4;
 if($items > 5) {
 echo "You get a 10% discount!";
 } else {
 echo "you get a 5% discount!" ;


Is this your full code? If so, try adding the closing tags for paragraph, body and html.
If it isn't the full code, please post the full version and say what error you're getting.


I am getting the output as the 5% discount but it tells I have make a mistake


Oops, I apologise for not seeing this before, but your mistake is a simple typo. Make the 'y' on your second message capital, as it is case-sensitive.

you get a 5% discount! should be You get a 5% discount!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.