Jump to content

[SOLVED] Reading XML Sent to the my Script


DexterR

Recommended Posts

I have a flash app that sends an XML file to my php script. How would I then load that script in php? I'd like to you simpleXML if possible, it seems the easiest and the XML file isn't large. Also, do I need the name of the XML file? It seems to generate a random name each time.

Any help would be much appreciated!

I would use the DOM object in PHP to parse the XML. Something like this:

 

<?php
$doc = new DOMDocument();
$xml = file_get_contents("http://url-of-your-xml");
$doc->loadXML($xml);
?>

 

Here is more info on DOM:

http://us2.php.net/book.dom

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.