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 cmb02000601 folder is queried. 2. the xml file format is as follows: & lt ;? Xml & nbsp; version1.0 & nbsp; encodingUTF-8? & Gt; & lt; result & gt; & lt; components & gt; 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