<?php

//---------------------------------------------------------------------------------------
//Print 2 dimensional array as an HTML table
//---------------------------------------------------------------------------------------
function print_table($array_2dim)
{
    print "<table border=2>";
    print "<tr bgcolor=cyan>";

    $keys = array_keys($array_2dim[0]);             //get all the keys of row 0 

    foreach ($keys as $key)                         //keys could be default 0 based
        print "<th>$key</th>";                      //or your own keys

    print "</tr>";

    for ($i = 0; $i < count($array_2dim); $i++)     //loop for number of rows                
    {
        print "<tr>";
        $values = array_values($array_2dim[$i]);    //get all the values  

        foreach ($values as $value)
            print "<td>$value</td>";

        print "</tr>";
    }
    print "</table>";
}

?>

<?php include "../include.php"; ?>      <!-- hyperlink to see the code -->