如果implexml_load_file不支持http调用
你可以用$str=file_get_content("http://www.dvd-cd-burner.net/dvd-cd-burner.xml")取得字符
再用
simplexml_load_string($str) 加载
你可以用$str=file_get_content("http://www.dvd-cd-burner.net/dvd-cd-burner.xml")取得字符
再用
simplexml_load_string($str) 加载
$xml = simplexml_load_file("http://www.dvd-cd-burner.net/dvd-cd-burner.xml");
if($xml)
{
echo "<pre>";
echo var_dump($xml);
echo "</pre>";}
没有问题,返回object(SimpleXMLElement)#1 (8) {
["MASTER_PAD_VERSION_INFO"]=>
object(SimpleXMLElement)#9 (3) {
["MASTER_PAD_VERSION"]=>
string(4) "3.01"
["MASTER_PAD_EDITOR"]=>
string(37) "PADGen 3.0.1.35 http://www.padgen.org"
["MASTER_PAD_INFO"]=>
string(231) "Portable Application Description, or PAD for short, is a data set that is used by shareware authors to disseminate information to anyone interested in their software products. To find out more go to http://www.asp-shareware.org/pad"
}
["Company_Info"]=>
object(SimpleXMLElement)#8 (10) {
["Company_Name"]=>
string(18) "Abdio Software Inc"
["Address_1"]=>
string(33) "Electronic Business City,Changhon"
["Address_2"]=>
object(SimpleXMLElement)#10 (0) {
}
["City_Town"]=>
string(8) "Mianyang"
["State_Province"]=>
string(7) "Sichuan"
["Zip_Postal_Code"]=>
string(6) "621000"
["Country"]=>
string(5) "China"
["Company_WebSite_URL"]=>
string(28) "http://www.dvd-cd-burner.net"
["Contact_Info"]=>
object(SimpleXMLElement)#11 (6) {
["Author_First_Name"]=>
string(5) "Abdio"
["Author_Last_Name"]=>
···········