<html>
<! Switch2.php                                                >
<! Chapter 4, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates a switch statement using an       >
<! expression.                                                >
<head>
<title>
  Demonstrating a switch statement.
</title>
</head>
<body>
<?php
  // Declare a variable by assigning a value.
  $myVar = 1.34;

  switch (true)
  {
    case ($myVar <= 1):
      print "\$myVar [".$myVar."] is less than [1].";
      break;
    case ($myVar > 2):
      print "\$myVar [".$myVar."] is greater than [2].";
      break;
    default:
      print "\$myVar is a [".$myVar."].";
      break;
  }
?>
</body>
</html>
