Lesson 2


#1

My code:





<?php
( $items = 6;) // Set this to a number greater than 5!

    { if ($items =< 1;) 
      echo "You get a 10% discount!";
    }
  ?>
</p>


Anyone see a problem?


#2

Hi first your if statement should be like that

if ( condition) {

}

And here

 if ($items =< 1;)

Remove the ; after the 1


#3

Still having problems





<?php
($items =< 6); // Set this to a number greater than 5!

    if ($items =< 1); {
      echo "You get a 10% discount!";
    }
  ?>
</p>



#4

Try this.

<?php
  $items = 10;
        
  if($items > 5) {
    echo "You get a 10% discount!";
  }
?>

#5

Hi here

if ($items =< 1); <== remove the ;

====
And

($items =< 6);

You. Should remove the < and you don't need of () around

So it's should be like that

$items = 6;

Then

if ($items =< 1)

It's like that

if (6 =< 1)

Which is false and the echo won't run so if you it to run you should change inside your condition like that

if ($items > 1)