How to use DOM to parse XML files with multi-dimensional structures in php

Source: Internet
Author: User
How to use DOM in php to parse XML files with multi-dimensional structures & lt; info & gt; & nbsp; & lt; title & gt; Why I Love You (2012) & lt; title & gt; & nbsp; & lt; cate & gt; Series & lt; cate & gt; & nbsp; & lt; genre & gt; type: Japanese Opera & lt; genre & gt; & nbsp; & l how to use DOM to parse XML files with multi-dimensional structures in php

Why I Love You (2012)
Series
Type: Japanese opera
Region: Japan
Director: Han Zhuyun
Actor: Ze Min Ying Longhua/Murakami/Nakamura/Okada Yide/More»
L et M ~ When there are already too many other users
Http://i-7.vcimg.com/f48c819a3ba24b4a20886277877373ac78438 (120x170)/thumb.jpg

12
BeeTV

Http://www.youku.com/v_show/id_XMzQ4MDQ3MDMy.html,http://www.youku.com/v_show/id_XMzQ4MDUzMzMy.html,
Http://www.youku.com/v_show/id_XMzQ4MDQ3MDMy.html,http://www.youku.com/v_show/id_XMzQ4MDUzMzMy.html,http://www.tudou.com/programs/view/TX_Awg3ephU,
Http://www.youku.com/v_show/id_XMzQ4MDQ3MDMy.html,http://www.youku.com/v_show/id_XMzQ4MDUzMzMy.html,http://www.tudou.com/programs/view/TX_Awg3ephU,


An XML file consists of multiple info tags.

------ Solution --------------------
PHP code
$ Xml = simplexml_load_file ('AA. XML'); foreach ($ xml-> info as $ v) {$ arr [] = (array) $ v;} print_r ($ arr );
------ Solution --------------------
Discussion

#2. you cannot download the link.

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.