How to reverse order of a foreach loop

Hi,
I am have a foreach loop creating each row of a HTML table. When I add a row, the new row is displayed at the bottom of the table. How could I make the table reverse the order of the rows, so that the most recently updated rows are at the top not the bottom.
Here is the code for the html table.
<?php include_once $_SERVER[‘DOCUMENT_ROOT’] . ‘/artgibney/includes/helpers.inc.php’; ?>

<!DOCTYPE html>
<html lang="en">
  <head>
  <style>
table,th,td
{
border:1px solid black;
border-collapse:collapse;
}
th, td
{
padding:6px;
}
        td { width: 50px; overflow: hidden; }
</style>
    <meta charset="utf-8">
    <title>Manage Teaching Points</title>
  </head>
  <body>
    <h1>Manage Teaching-points table</h1>
    <p><a href="?add">Add data to teachingpts table.</a></p> 
     <table>
     <tr>
  <th></th>
  <th></th>
  <th>Teaching pts</th>
  <th>Code</th>
  <th>Curriculum no.</th>
</tr>
      <?php foreach ($teachingpts as $teachingpt): ?>
        <li>
          <form action="" method="post">
            <tr>
              <input type="hidden" name="id" value="<?php
                  echo $teachingpt['id']; ?>">
              <td><input type="submit" name="action" value="Edit"></td>
              <td><input type="submit" name="action" value="Delete"></td>
              <td><?php htmlout($teachingpt['tp']);?></td>
              <td><?php htmlout($teachingpt['code']);?></td>
              <td><?php htmlout($teachingpt['currno']);?></td>
            </tr>
          </form>
        </li>
      <?php endforeach; ?>
    </table>
    <p><a href="..">Return to physCMS home</a></p>
    <?php include '../logout.inc.html.php'; ?>
  </body>
</html>

The PHP manual does give good examples, here. But I am not sure how to apply it. Perhaps I need to do this in the index.php file.
Thanks,
Shane

Hi,
I found the solution, here.
I simply needed to replace,

<?php foreach ($teachingpts as $teachingpt): ?>

with

<?php foreach (array_reverse($teachingpts) as $teachingpt): ?>

Thanks,
Shane