PHP: How to generate a <ul><li> tree in an xml2assoc array result?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have seen many PHP function on how to generate a <ul><li> tag but my array input is quite complicated I guess. It is an array returned from a custom function called xml2assoc My question is how can I convert the returned xml2assoc array result to a <ul><li> formatted HTML code using PHP. Thanks. $tree = array( 0 => array( 'tag' => 'NavigationMode', 'value' => array( 0 => array( 'tag' => 'Title', 'value' => 'Introduction' ), 1 => array( 'tag' => 'NavigationNode', 'value' => array( 0 => array( 'tag' => 'Title', 'value' => 'Sub Intro' ) ) ) )