<html>
<! IfThen1.php                                                >
<! Chapter 4, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates an if statement with two          >
<! nested expressions, which is a compound evaluation.        >
<head>
<title>
  Demonstrating an if statement.
</title>
</head>
<body>
<?php
  // Declare a variable by assigning a value.
  $myVar = -1.234;

  // Print and format variables to the web page.
  print "Before the if-statement, ";
  print "\$myVar is [".$myVar."] and a double data type.<br>\n";

  // Check if only one of two expression is true.
  if (($myVar) xor (1 == 2))
  {
    // Print the output as three statements.
    print "After the if-statement, \$myVar is: ";
    print "[".$myVar."] and a [".gettype($myVar)."] data type.<br>\n";
  }
?>
</body>
</html>
