Student H

[article] [edit page] [discussion] [history]

From Humanitarian-FOSS Project Development Site

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type"
      content="text/html; charset=iso-8859-1">
  <title>Twelve Days of Christmas</title>
</head>
<body bgcolor="#ffffff">
  <h1>
  <?php
    	$twelvedays = array("first"=>"a partridge in a pear tree","second"=>"Two turtle doves","third"=>"Three French hens", 
"fourth"=>"Four calling birds" , "fifth"=>"Five golden rings" , "sixth"=>"Six geese a-laying" , "seventh"=>"Seven swans a-swimming" , 
"eighth"=>"Eight maids a-milking" , "ninth"=>"Nine ladies dancing" , "tenth"=>"Ten lords a-leaping" , "eleventh"=>"Eleven pipers piping" , 
"twelfth"=>"Twelve drummers drumming");

	function song($song)
	{
		foreach($song as $days => $items)
		{
			print "On the {$days} day of Christmas, my true love gave to me {$items}<br>";
		}
	}
	song($twelvedays);
  ?>
  </h1>
</body>
</html>
Personal tools