I'm not quite sure what you're having difficulty with, but this is, in principle, like mapping a file system structure ... which I do like this:
function sitemap($path) { if ($dhandle = opendir($path)) { echo("<ul>"); while ($file_name = readdir($dhandle)) { if ($file_name == "." or $file_name == "..") continue; echo("<li>$file_name</li>"); if (is_dir("$path$file_name")) sitemap("$path$file_name/"); } closedir($dhandle); echo("</ul>"); } } // end of fn sitemap this shows the general principle, if you're already getting the top level okay you should be able to use this sort of thing to get the rest Tim www.chessish.com <http://www.chessish.com> ---------- From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 21 January 2002 11:27 To: [EMAIL PROTECTED] Subject: recursive hi, I hv an XML tree with some elements which keep repeating.. As of now, I am able to print only the last element.. I need to make the loop recursive in order to print all the elements.. wud appreciate any help.. TIA, sands like this: <app_info> <app_id>001</app_id> <app_name>WORD</app_name> <app_info> <app_id>002</app_id> <app_name>excel</app_name> </app_info> <app_info> <app_id>003</app_id> <app_name>PPt</app_name> </app_info> </app_info> <app_info> <app_id>004</app_id> <app_name>ZIP</app_name> </app_info> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]