:::

4. If statements

Say we want to write a program that asks whether your name is longer than 7 letters. If the answer is yes, we can respond with "You have a long name!" We can do this with an if statement:

<?php
  $age = 17;

  if( $age > 16 ) {
    echo "You can drive!";
  }
?>

:::

語系選擇