tags:

views:

32

answers:

2

using php how do I go to a website and receive a list of all the xml files on a site. (It would also be nice to get the last date changed also)

There is a html files linking to html pages with a xml counterpart, does that help?

A: 

You might want to use SimpleXML or file_get_contents function depending on your requirements.

Sarfraz
A: 

Depends on what you mean by "list of all xml files". There's no way to find unlinked files without a brute force search (which is impossible in practice at this scale). If you only care about linked files, you'll either have to crawl manually and match links in the content of the pages, or do a Google search with site:example and inurl:.xml then parse the results.

Max Shawabkeh
All of the xml files are in 1 directory, I just need to know the names of these files so i can access them
Klanestro
Even so, unless the site gives you a directory listing, you can't guarantee to get the filenames without a brute force search. You can always guess a pattern though - if there are files named a1.xml, a2.xml there's a good chance that there's an a3.xml as well.
Max Shawabkeh