simplexml_load_string

We can create an object by using XML formatted string to an object by using simplexml_load_string function in PHP. Here we will take our sample XML formatted string.

xml-sample1.php

<?Php
require "xml-sample1.php";
$str=simplexml_load_string($str_xml);
print_r($str);
?>

The Output is here.

SimpleXMLElement Object ( [name] => Abcd [address] => SimpleXMLElement Object ( [door_no] => 234-ac [street] => Great Wall [city] => Alabama ) )

Subscribe to our mailing list

* indicates required
Subscribe to plus2net
Your Rating


Google+

Post Comment This is for short comments only. Use the forum for more discussions.




Subscribe to our mailing list

* indicates required
Subscribe to plus2net
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2018 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer