Skip to content

Instantly share code, notes, and snippets.

@CrisHazzard
Created January 13, 2017 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CrisHazzard/668c621eed6ba96b188b317fbdbd42c9 to your computer and use it in GitHub Desktop.
Save CrisHazzard/668c621eed6ba96b188b317fbdbd42c9 to your computer and use it in GitHub Desktop.
Display 2D Array As Table
$out = "";
$out .= "<table>";
foreach($arrayname as $key => $element){
$out .= "<tr>";
foreach($element as $subkey => $subelement){
$out .= "<td>$subelement</td>";
}
$out .= "</tr>";
}
$out .= "</table>";
echo $out;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment