<?php function nestedList ($array, $class = NULL) { $list = "<ul class='{$class}'>"; foreach ($array as $key => $value) { $list .= "<li>{$key}"; $list .= "<ul>"; foreach($value as $data_key => $data_value) { $list .= "<li>{$data_key} - {$data_value}</li>"; } $list .= "</ul></li>"; } $list .= "</ul>"; return($list); } $mein_array = array( "England" => array( "Code" => "EN", "Capital" => "London", "Currency" => "Pfund", "Continent" => "Europoa", "Language" => "Englisch" ), "Deutschland" => array( "Code" => "DE", "Capital" => "Berlin", "Currency" => "Euro", "Continent" => "Europoa", "Language" => "Deutsch" ), "Kanada" => array( "Code" => "CA", "Capital" => "Ottawa", "Currency" => "Kanad. Dollar", "Continent" => "Nordamerika", "Language" => "englisch" ) ); echo nestedList($mein_array); ?>