Jump to content

Get xml data and write to file


denoteone

Recommended Posts

I am trying to grab the contents of an XML page and then write them to a local file on my server, but when I echo the contents I am not getting the XML tags?

 

<?PHP
$url = 'http://www.sitethathostxml.com/myfile.xml';
    $str = file_get_contents($url);
echo $str;
?>

 

my echo is just the text and not the tags? Should I use another function to pull the data?

Link to comment
https://forums.phpfreaks.com/topic/190151-get-xml-data-and-write-to-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.