Conditionals and Control Flow 4/4

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 shouldecho "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".
?
Hint
Test how well you're learning and fill in gaps with Codecademy Pro.Learn more.
Your code could look something like this:
<?php
  if(10 < 3) {
    echo "The condition is true";
  }
  else {
    echo "The condition is false";
  }
?>
Conditionals and Control Flow 4/4
<html>
  <head>
  </head>
  <body>
    <p>
      <?php
      $var=5;
        if($var < 5) {
            echo "The condition is true";
        }
        else{
            echo "The condition is false";
        }

      ?>
    </p>
  </body>
</html>

Comments

Popular posts from this blog

MEGA 暫存檔案刪除

IOS GCD多執行緒

利用CMD指令強制刪除