How does PHP write XML in the PHP file include $ _ SESSION ['phone'] and write its value into the XML file ?, Http://www.jb51.net/article/21450.htm,xmland PHP are mutually converted and encapsulated. :xmlparse.php: how to write XML
In the php file, there is a $ _ SESSION ['phone']. how can I implement this function to write its value to the XML file?
------ Solution --------------------
Http://www.jb51.net/article/21450.htm
------ Solution --------------------
Conversion between XML and PHP encapsulation function: xmlparse. php
Demo:
PHP code
Include (dirname (_ FILE __). "/xmlparse. php "); $ arr = array (1," name "," admin ", 100); $ contXML = dump_xml_config ($ arr," xml "," UTF-8 "); // put the file file_put_contents_safe ("/path/test. xml ", $ contXML," w "); echo $ contXML; # Source code #
#
# <0> 1
# <1> name
# <2> admin
<3> 100
#
------ Solution --------------------
Discussion
Conversion between XML and PHP encapsulation function: xmlparse. php
Demo:
PHP code
Include (dirname (_ FILE _). "/xmlparse. php ");
$ Arr = array (1, "name", "administrator", 100 );
$ ContXML = dump_xml_config ($ arr, "xml", "UTF-8 ");
// Put the file
File_put_conte ......