如果implexml_load_file不支持http调用
你可以用$str=file_get_content("http://www.dvd-cd-burner.net/dvd-cd-burner.xml")取得字符
再用
simplexml_load_string($str) 加载

解决方案 »

  1.   

    第二,如果对方重定向的,你可能取不到内容,第三个就是对方的xml不规范,你可能也无法加载(引号没转成实体等等)你可以自已做个文件,测一下
      

  2.   


    $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"]=>
    ···········
      

  3.   

    我发现了,这个问题出在哪,是操作系统问题,我现在用的是vista,而我把代码在xp系统上操作时,就没有问题。不过还是谢谢个位。帮助。