How to write XML in PHP

Source: Internet
Author: User
Tags php write
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 ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.