How to capture xml data with php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
malcolmclark2001
Forum Newbie
Posts: 1
Joined: Fri Apr 25, 2008 4:18 pm

How to capture xml data with php

Post by malcolmclark2001 »

I am trying to capture xml data from a remote site. Here is my scenario;

* log on to remote website
* click a button to download an xml list
* the xml file contents are displyed in another browser window (I have to copy and paste the data to a text editor)
- if I view source, I get the calling program code but not the result in the window
- I want to capture the xml code to a variable

This is the line that produces the xml file; I would like to capture the xml code that is produced with this code.
https://www.website.com/dealermaint/quo ... %20Manager" target="_new">

This will open the remote site and display the html code;
fopen("https://www.psndealer.com/dealermaint/quote_xml.asp", "rb");

Can someone help with this. I am so sad :(

Thank You,
Malcolm Clark
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: How to capture xml data with php

Post by jaoudestudios »

to capture the feed to a variable use

Code: Select all

$data = file('http://www.url.com');
Post Reply