PHP provides an example of XML data to an array of examples in detail

Source: Internet
Author: User

First in the development, will certainly encounter calls to other people's interface the other side to return to you the data is the XML format//can after you get the XML data to be transferred to the group to do data processing! $xmlstring = <<<xml<?xml version= "1.0" encoding= "Utf-8"?><note><name> Le Yangjun </name> <from> Jiangxi Fuzhou </from><working>BJ</working><desc> Le Yangjun php related Talk! </desc></note>XML; $xml = simplexml_load_string ($xmlstring), $data [' tk '] = Json_decode (Json_encode ($xml) , TRUE), echo "<pre>";p Rint_r ($data), foreach ($data as $values) {foreach ($values as $DV) {echo $DV. \ n ";}}


PHP provides an example of XML data to an array of examples in detail

Related Article

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.