/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Creates recursively a nested HTML UL of array keys. * @param array $array Array * @return string Nested UL string */ $recursion=__FUNCTION__; $out='<ul>'."\n"; foreach ($array as $key => $elem) $out .= '<li>'.$key.$recursion($elem).'</li>'."\n"; $out .= '</ul>'."\n"; return $out; } $ul=Get_Array_Keys_UL($_POST); echo $ul;