Jump to content

SimpleXMLElement and reading .xml files


graham23s

Recommended Posts

Hi Guys,

 

i'm experimenting with reading .xml files currently i have:

 

<?php
       
$filecontent = file_get_contents("filename.xml");

$xml = new SimpleXMLElement($filecontent);

echo $xml->asXML();

?>

 

this works great, it reads back in a nice format the contents of the .xml file, but im wanting to take information from the .xml file and store them in variables for later use but i'm not sure how to search the .xml file and take what i want, any advice would be great

 

cheers guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/66745-simplexmlelement-and-reading-xml-files/
Share on other sites

Hi B,

 

for example in this .xml file there is a posters name:

 

<file poster="[email protected]"

 

i was wanting to read the .xml grab who the poster is and store it in a variable if possible

 

thanks mate

 

Graham

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.