Skip to content

Instantly share code, notes, and snippets.

@tamura
Created October 4, 2010 02:28
Show Gist options
  • Save tamura/609176 to your computer and use it in GitHub Desktop.
Save tamura/609176 to your computer and use it in GitHub Desktop.
function maketable($array){
$ret='<table>';
$tableheader=array_keys($array[0]);
$ret.="<tr>";
foreach($tableheader as $name){
$ret.="<th>$name</th>\n";
}
$ret.="</tr>\n";
foreach($array as $i=>$row){
$ret.="<tr><td>".implode("</td><td>",$row)."</td></tr>";
}
$ret.="</table>";
return $ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment