<html>
<! Localtime.php                                              >
<! Appendix F, Oracle Database XE PHP Web Programming         >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This demonstrates capturing the array elements of a        >
<! timestamp.                                                 >
<head>
<title>
  Appendix F : Localtime.php
</title>
<style>
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
</style>
</head>
<body>
<?php
  // Print HTML table and column headers.
  print '<table border="1" cellpadding="3" cellspacing="0">';
  print '<tr>';
  print '<td colspan="3" align="center" class="e">';
  print 'Today ['.date("d M y").']';
  print '</td>';
  print '</tr>';
  print '<tr>';
  print '<td class="e">Name</td>';
  print '<td class="e">Value</td>';
  print '</tr>';

  // Define the local times.
  $elements = localtime(time(),true);

  // Print array contents into HTML table.
  foreach ($elements as $name => $value)
  {
    print '<tr>';
    print '<td class="v">'.$name.'</td>';
    print '<td class="v">'.$value.'</td>';
    print '</tr>';
  }

  // Print HTML table close.
  print '</table>';
?>
</body>
</html>
