public static function getReadableArrayContentsHTML($sKey, $vValue) { $_aOutput = array(); $_aOutput[] = $sKey ? "<h3 class='array-key'>" . $sKey . "</h3>" : ""; if (!in_array(gettype($vValue), array('array', 'object'))) { $_aOutput[] = "<div class='array-value'>" . html_entity_decode(nl2br(str_replace(' ', ' ', $vValue)), ENT_QUOTES) . "</div>"; return "<li>" . implode(PHP_EOL, $_aOutput) . "</li>"; } foreach ($vValue as $_sKey => $_vValue) { $_aOutput[] = "<ul class='array-contents'>" . self::getReadableArrayContentsHTML($_sKey, $_vValue) . "</ul>"; } return implode(PHP_EOL, $_aOutput); }