返回的是字符串吗?$response = file_get_contents("http://wap.xxx.com/UserProvision.aspx?mobile=13xxxxxxxxx);parse_str($response, $varlist);print_r($varlist);

解决方案 »

  1.   

    同事说好像要用MSXML2.ServerXMLHTTP才行,麻烦各位大哥啦
      

  2.   

    在网页中通过MSXML2.ServerXMLHTTP 用Get方法调用http://wap.xxx.com/UserProvision.aspx?mobile=13xxxxxxxxx这个接口
    调用后可获取的有三个信息:1:result 2:id 3:name
      

  3.   

    同事说好像要用MSXML2.ServerXMLHTTP才行
    谁说的?
      

  4.   

    $response = file_get_contents("http://wap.xxx.com/UserProvision.aspx?mobile=13xxxxxxxxx");parse_str($response, $varlist);print_r($varlist);稻草人的方法不对吗???????????
      

  5.   

    用稻草人大哥的方法后,运行PHP只显示了"Array ( )",其它什么都没有我是这样写的:
    <?php
    error_reporting(0);
    header("Content-type:text/vnd.wap.wml");
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org//DTD//wml_1.1.xml\">";
    echo "<wml>";
    echo "<card>";
    echo "<p>";
    $response = file_get_contents("http://wap.xxx.com/UserProvision.aspx?mobile=13832862812");
    parse_str($response, $varlist);
    print_r($varlist);
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    ?>
      

  6.   

    echo $response;看看是什么东西<?
    $response='result=1&id=1001&name=1001';
    list($result,$id,$name)=explode("&",$response);
    list($var,$value)=explode("=",$result);
    $$var=$value;
    list($var,$value)=explode("=",$id);
    $$var=$value;
    list($var,$value)=explode("=",$name);
    $$var=$value;
    echo $result;
    echo '<br />';
    echo $id;
    echo '<br />';
    echo $name;
    ?>
      

  7.   

    直接
    $response = file_get_contents("http://wap.xxx.com/UserProvision.aspx?mobile=13832862812");
    echo $response;
      

  8.   

    $URL="http://wap.xxx.com/UserProvision.aspx?mobile=".$phone;
    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,$URL);
    curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.0);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "");
    ob_start();
    curl_exec($ch);
    $data=ob_get_contents();
    ob_end_clean();
    curl_close ($ch);