<html>
<! 12Days.php                                                 >
<! Chapter 4, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates a for loop and nested switch      >
<! statements, where the second switch statement demonstrates >
<! the fall through principal.                                >
<head>
<title>
  Demonstrate a loops with case statements and fall through.
</title>
</head>
<body>
<?php
  // Print the song title.
  print "<u>The Twelve Days of Christmas</u><p>";

  // Start a loop until a condition is met.
  for ($i = 0;$i < 3;$i++)
  {
    // Prints the beginning of a verse.
    print "On the ";

    // Demonstrate a case series using a break to exit switch statement.
    switch ($i)
    {
      case 0:
        print "first ";
        break;
      case 1:
        print "second ";
        break;
      case 2:
        print "third ";
        break;
    }

    // Print common lines in the verses.
    print "day of Christmas<br>";
    print "my true love sent to me:<br>";

    // Demonstrate an inverted case series and fall through.
    switch ($i)
    {
      case 2:
        print "a Three French Hens<br>";
      case 1:
        print "a Two Turtle Doves and<br>";
      case 0:
        print "A Partridge in a Pear Tree<p>";
    }
  }
$myVar = true;

if ($myVar)
{
  print "here";
  include("While.php");
  include("While.php");
}
else
  print "there";
?>
</body>
</html>
