simplexml_load_string
$xml_string : Required , formatted xml data string $class_name : Optional , return object of specified class $options : Optional , Additional Libxml parameters ns : Optional , Namespace prefix is_prefix : True or False based on ns ( prefix True , URI is false ) Here we will take our sample XML formatted string. xml-sample1.php
The Output is here.
Example 2
Output is here
Example 3
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
![]() |
PHP & XML
getName(): Name of the XML element or tag
children(): Children of a XML node
count(): Counting number of Children of an XML element
simplexml_load_file(): creating object by reading from XML file
simplexml_load_string(): creating object by using XML formatted string
asXML: Getting string output or writing to file
addAttribute(): Adding attribute to element of XML object
addChild(): Adding Child element to element of XML object
getNamespaces(): Getting NameSpaces from XML object
XML from Database(): Generating XML from table records
|