This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by teriqn
almost 10 years

why doesn't this work for my 2/4 code

Answer 53afd7427c82cac8df001c3d

2 votes

Permalink

if ($items < 5) is saying “if the items variable is less than 5, print out the statement to the console. So what you need to do is change the condition (which is what the excerise prompts you to do) to: if ($items > 5)

Also the variable $items needs to be set to a number (not inside quotes) E.g. $items = 6;

points
Submitted by haaris173
almost 10 years

Answer 53e5b0bb8c1ccca64f000b95

1 vote

Permalink

i also change print to echo but i still have that alert!!!

points
Submitted by arxmirzaei
over 9 years

Answer 53e5aff39c4e9d2bcf000b44

-1 votes

Permalink

i set that and i can see answer right now . but I get this alert

Oops, try again. Did you set $items to a number greater than 5?

MY CODE IS:

<html>
  <head>
  </head>
  <body>
    <p>
      <?php
        $item = 6;  
        
        if( $item > 5 ) {
          print "you get a 10% discount!";
        }
      ?>
    </p>
  </body>
</html>
points
Submitted by arxmirzaei
over 9 years