Skip to content

Instantly share code, notes, and snippets.

@gitllermopalafox
Created May 9, 2016 18:31
Show Gist options
  • Save gitllermopalafox/3caa42e750c793428d4e324b41d573f1 to your computer and use it in GitHub Desktop.
Save gitllermopalafox/3caa42e750c793428d4e324b41d573f1 to your computer and use it in GitHub Desktop.
//http://stackoverflow.com/questions/1386331/php-print-r-nice-table
function myprint_r($my_array) {
if (is_array($my_array)) {
echo "<table border=1 cellspacing=0 cellpadding=3 width=100%>";
echo '<tr><td colspan=2 style="background-color:#333333;"><strong><font color=white>ARRAY</font></strong></td></tr>';
foreach ($my_array as $k => $v) {
echo '<tr><td valign="top" style="width:40px;background-color:#F0F0F0;">';
echo '<strong>' . $k . "</strong></td><td>";
myprint_r($v);
echo "</td></tr>";
}
echo "</table>";
return;
}
echo $my_array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment