Find the PHP code to parse the XML file. 100 points. Thanks

Source: Internet
Author: User
Find the PHP code to parse the XML file. 100 points. Thank you. 1, under the specified folder. For example, the first XML file in the CMMB/02/000601 folder. 2. the xml file format is as follows: & lt ;? Xml & nbsp; version = "1.0" & nbsp; find the PHP code to parse the XML file. 100 points. Thank you.
1, under the specified folder. For example, the first XML file in the CMMB/02/000601 folder.

2. the xml file format is as follows:





Common_1
Common
IT age


Message/130122001
2013-01-21 17:47:02
<! [CDATA [online shopping affects Chinese consumers' consumption habits]>
揭秘“线下试用,线上购买”的“抄码族”
1
False
Text/html
FA2BD84B53B94CE8B6E35E0F2CB5CBE9.jpg


Message/130122002
2013-01-21 17:47:02
<! [CDATA [Baidu will be recovered after Apple dismounting]>
“除了公关缺失,苹果在中国还需弥补开发者关系这一课。”
1
False
Text/html
95C96D68E4C6449E860F7C514762D805.jpg


Message/130122003
2013-01-21 17:47:02
<! [CDATA [2012 favorite APP rankings]>
北京晨报制作出一份APP排行榜:我们最爱的十款产品。
1
False
Text/html
F851463af50e49dba193720.bca1ffd3.jpg


N items.






3. store the data in the XML file into an array.
For example, N items
$ Arr1 [$ N] = id
$ Arr2 [$ N] = time
$ Arr3 [$ N] = title
$ Arr4 [$ N] = description
$ Arr5 [$ N] = isImageOnly
$ Arr6 [$ N] = content_type
$ Arr7 [$ N] = icon

4. Loop "N" to output an array.
PHP beginners are not very good. please code. thank you...
Xml
------ Solution --------------------
Http://www.cnblogs.com/likwo/archive/2011/08/24/2151793.htmlcheck this
------ Solution --------------------
Simplexml_load_file (filename)
------ Solution --------------------
Demo address: http://sandbox.onlinephpfunctions.com/code/afd0a674a5eaf9ac910d2b3a2b8ec37ff701cec2

$ Str = <
 
 



Common_1
Common
IT age


Message/130122001
2013-01-21 17:47:02
<! [CDATA [online shopping affects Chinese consumers' consumption habits]>
揭秘“线下试用,线上购买”的“抄码族”
1
False
Text/html

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.