phantom552 Posted January 9, 2013 Share Posted January 9, 2013 Let's say I have a laundry list of *possible* XML files with a sequential commonality, IE: http://somewebsite.com/archivedthing/1.xml to http://somewebsite.com/archivedthing/100000.xml With no way of knowing beforehand how many of the possible XML files in that range are valid. Is there a way to automatically run through all of these URLs and dump the valid numbers into a delimited file of some kind? I think I can figure out how to check each URL for the presence of the XML data I want, but I'm not sure how to automatically progress through each possible URL, and dump the data I need into a file I can use later. Thanks! Quote Link to comment Share on other sites More sharing options...
phantom552 Posted January 9, 2013 Author Share Posted January 9, 2013 Made a little progress, but I know my syntax is fubar on the $xml line, trying to add $value between http://www.website.com/item= and &xml so I end up with http://www.website.com/item=____&xml where ____ is a value in the range. Any help is appreciated. $possibleids = range(1,100); foreach ($possibleids as $value){ $xml = 'http://www.website.com/item=$value&xml'; } Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted January 9, 2013 Share Posted January 9, 2013 This is certainly not something you want to be doing using your web browser. This is the sort of thing suited to a command line script. I'm not sure why you would not know the exact xml urls that need reading, please elaborate. You have a simple error in your code. Variables are not translated inside single quotes, only inside double quotes. If you want to use single quotes then the following will work: $possibleids = range(1,100); foreach ($possibleids as $value) { $xml = 'http://www.website.com/item=' . $value . '&xml'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.