17
2014/09
问题写了一个小程序<?php
$xml = file_get_contents('x.xml');
$obj = simplexml_load_string($xml);
var_dump($obj);
?> <!-- x.xml -->
<?xml version="1.0" encoding="utf-8"?>
<wl_website_spider>
<source_category><![CDATA[AVC_TEST]]></source_category>
<source_website><![CDATA[SHAREWARE]]></source_website>
<source_press><![CDATA[3]]></source_press>
<proxy><![CDATA[OFF]]></proxy>
</wl_website_spider> 结果无法读取到xml的内容,去掉<![CDATA[]>就可以,是simplexml_load_string(simplexml_load_file
#技术帖
#php
#xml
#技术分享