Generate XML file from PHP array using SimpleXMLElement

You can Generate XML file from PHP array using SimpleXMLElement in php language, which will be easy to read data from the xml formatted data.just take the whole list to an array & by using SimpleXMLElement the data will generated in an xml format.

 

PHP Code

 Output XML Code

after executing the script see the source code, then you will found the xml elements in file.The output for the above code is as follows.