The above code works better this way.
<?php
function reduceToTable($html, $p) {
$html .= "<TR><TD><a href=\"$p.html\">$p</a></td></tr>\n";
return $html;
}
$list = Array("page1", "page2", "page3");
$tab = array_reduce($list, "reduceToTable");
echo "<table>".$tab . "</table>\n";
?>