public static function toHtml($array, $ordered = FALSE, $nested = TRUE) { if (!is_array($array)) { return '<ul><li>' . gettype($array) . ' ' . Saf_Debug::introspectData($value) . '</li></ul>'; } $return = ''; $return .= $ordered ? '<ol>' : '<ul>'; if (count($array) == 0) { $return .= '<li>None</li>'; } else { foreach ($array as $key => $value) { $return .= '<li>'; if (is_object($value)) { $value = Saf_Debug::introspectData($value); //#TODO #2.0.0 make a more user friendly version of this output } if ($nested && is_array($value)) { $value = self::toHtml($value, $ordered); } $return .= "{$key}: {$value}"; $return .= '</li>'; } } $return .= $ordered ? '</ol>' : '</ul>'; return $return; }