DEV Community

Programming Dive
Programming Dive

Posted on

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/

Top comments (0)