Saturday, April 20, 2013

XML to DOM

Today, XML is used in world wide to transfer the data from one server to another sever. It is more popular as it is independent of operating system. you can define your own tags.

How to Convert XML to DOM?
Following are the  number of function in PHP, which can convert your xml to dom, so that you can access all xml elements and their values.

SimpleXmlElemnet

$xmlString = '
  Arun
  Mohali
  Punjab
  india
';
$domArray = new SimpleXMLElement($xmlString);
echo "
";
print_r($domArray);
echo "
";


No comments:

Post a Comment