this PHP function displays any given directory structure as recursive list.
it even outputs nice HTML markup code with indenting.

download options for directories / directory structure to list

you can download the source as PHP file,

open the file as plain text in a new window or

get the code in a textarea to copy it.