I have seen many PHP function on how to generate a tag but my array input is quite complicated I guess. It is an array returned from a cust
If you have XML as input, why not use XSLT to transform it to ?
I guess your input looks something like this (I assume "NavigationMode" is a typo):
Introduction
Sub Intro
Module 1
With a small XSLT 1.0 stylesheet:
-
This output is produced:
-
Introduction
- Sub Intro
- Module 1
The PHP documentation shows how to use XSLT. It's simple.