Fixed a better structure, renamed the recursive function, changed the parameter list, build the HTML in to a returned string instead of just echo the navigation, made some examples.