Reputation: 18649
I have a simple xml file. I know which fields it will have ahead of time. What can you guys recommend is the best way for me to get the value of those fields using php?
Thank you :)
Upvotes: 1
Views: 141
Reputation: 25604
You can go with XML Parser, however the nice and simply way is to use SimpleXML
Upvotes: 0
Reputation:
SimpleXML is great for quick reading/writing of XML files. Here's an example:
<root>
<node>
<sub>Text</sub>
</node>
</root>
$xml = new SimpleXMLElement('xml_file.xml', 0, true);
echo $xml->node->sub; // Displays "Text"
Upvotes: 7