Ajax-loader-large-white
Conditionals and Control Flow
All Together Now!

Great work! Now let's practice using if / else statements. Do as much as you can by yourself, but if you need a reminder, click the "Stuck? Get a hint!" button below.

Instructions
  1. On line 8, write an if / else statement, just like we did in the last exercise. Here's what the outline of the code looked like:
<?php
  if (this condition is true) {
    // do this code
  }
  else {
    // do this code instead
  }
?>
  1. If your condition is true, your code should echo "The condition is true"

  2. Otherwise (else) when it is false, your code should echo "The condition is false".

  3. Make sure your condition evaluates to false, so that your program prints out "The condition is false".

?
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Your code could look something like this:

<?php
  if(10 < 3) {
    echo "The condition is true";
  }
  else {
    echo "The condition is false";
  }
?>
index.php
project
View Preview