Sorry, but I’m new to accessing return from another domain. I have this url and if you view its source you will see the return xml. How do I get those xml return in php?
Because later I’ll be parsing those xml. But now I’m stuck to this. T_T
link: http://ib.sand-08.adnxs.net/ptv?id=610860
Should I use curl? or just file_get_contents or fopen will do the trick?
Thanks,
The SimpleXML library allows you to do that.
That will grab the external XML and load it into a SimpleXML object. From there you can use that object to manipulate the XML data as needed.
There is no need for you to code the transport layer yourself, unless you need special control over the HTTP requests. As Gordon pointed out,
libxml_set_streams_contextcan give you some control, but won’t give you the degree of control that something likecURLwould.