View Discussion Improve Article Save Article View Discussion Improve Article Save Article In this article, we will learn how to process XML using PHP. We have already learnt the basics of XML and their differences with respect to HTML. Different elements of XML can be learnt from XML Elements to understand the working of the following programs. The simplexml_load_string() function is used to parse the given XML and then the XML object can be used for accessing the XML data. Example 1: The following example reads and prints the given XML string. HTML
Output: SimpleXMLElement Object ( [to] => GeeksForGeeks [from] => Tom [heading] => Submission [body] => Please see my articles of PHP! ) Example 2: The following example demonstrates how to get XML node values using PHP. The node values are shown in the output given below. HTML
Output: |