build_table => Build Array to html table.
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
function build_table($array){
// start table
$html = '<table>';
$html .= '<tr>';
foreach($array[0] as $key=>$value){
$html .= '<th>' . $key . '</th>';
}
$html .= '</tr>';
foreach( $array as $key=>$value){
$html .= '<tr>';
foreach($value as $key2=>$value2){
$html .= '<td>' . $value2 . '</td>';
}
$html .= '</tr>';
}
$html .= '</table>';
return $html;
}