Created
October 26, 2012 02:49
-
-
Save CrowderSoup/3956623 to your computer and use it in GitHub Desktop.
Better var_dump for Arrays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PrintArray($aVals) | |
{ | |
echo "<ul>"; | |
foreach($aVals as $key => $val) | |
{ | |
if(is_array($val)) | |
{ | |
echo "<li><strong>{$key}</strong>"; | |
PrintArray($val); | |
echo "</li>"; | |
} | |
else | |
{ | |
echo "<li>{$key}: {$val}</li>"; | |
} | |
} | |
echo "</ul>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment