本帖最后由 qq35610 于 2011-10-10 10:16:13 编辑

解决方案 »

  1.   

    可以用fopen打开这个url地址,获取返回的字符串,前提您的php环境里面php.ini打开allow_url_fopen
    具体可以看php手册中fopen函数的说明
      

  2.   

    <?php
     highlight_file("http://www.youdao.com/smartresult-xml/search.s?type=mobile&q=13812345555");
    ?>
      

  3.   

    文件不大的话用dom + xpath
      

  4.   

    $xml = <<< XML
    <?xml version="1.0" encoding="gbk"?>
    <smartresult>
    <product type="mobile">
    <phonenum>13812345555</phonenum>
    <location>江苏 连云港</location>
    </product>
    </smartresult>
    XML;
    $dom = simplexml_load_string($xml);
    echo iconv('utf-8', 'gbk', $dom->product->location);