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 wokring 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.
SimpleXMLElement Object ( [to] => GeeksForGeeks [from] => Tom [heading] => Submission [body] => Please see my artciles 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.
- How to universally parse JSON into blocks using jQuery ?
- Python | Parse a website with regex and urllib
- Why is Parse Server the future of Backend As A Service?
- Node | url.parse(urlString, parseQueryString, slashesDenoteHost) API
- Node.js | path.parse() Method
- Node.js | querystring.parse() Method
- Run Python script from Node.js using child process spawn() method
- Introduction and Installation process of Gulp
- Difference between process.nextTick() and setImmediate() Methods
- Global, Process and buffer in Node.js
- Node.js | process.versions Property
- Node.js | process.mainModule Property
- Node.js | process.chdir() Method
- Node.js | process.argv Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.