DEV Community

Programming Dive
Programming Dive

Posted on

1

XML Parsing in PHP

XML stands for EXtensible Markup Language which is a markup language that is both human-readable and machine-readable.

PHP has provided inbuilt function simplexml_load_string() to process XML and fetch information from it. This function was introduced in PHP in version 5.

simplexml_load_string ( string $data [, string $class_name = “SimpleXMLElement” [, int $options = 0 [, string $ns = “” [, bool $is_prefix = FALSE ]]]] ) : SimpleXMLElement

Where-
string $data : XML data in string format.
string $class_name : optional parameter. It will return an object of the specified class (if any).
int $options : Optional parameter. It specifies additional Libxml parameters.
string $ns : Optional parameter. It specifies a namespace prefix or URI
bool $is_prefix : Optional parameter. Returns TRUE if ns is a prefix, FALSE if ns is a URI. The default is FALSE.

for more detail information check this link

https://programmingdive.com/understanding-xml-parsing-using-php/

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more