解决方案 »

  1.   


    $url = 'http://service.t.sina.com.cn/widget/WeiboShow.php?width=470&height=380&fansRow=1&ptype=1&speed=100&skin=-1&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=1391486805&verifier=624116a0&colors=d6f3f7,ffffff,666666,117d6e';$content = file_get_contents($url);preg_match_all('/<dd\s+class="msg">(.*?)<\/dd>/is',$content,$arr) ;
    echo '<pre />';
    print_r($arr[1]);
      

  2.   


    [code=PHP]
    $url = 'http://service.t.sina.com.cn/widget/WeiboShow.php?width=470&height=380&fansRow=1&ptype=1&speed=100&skin=-1&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=1391486805&verifier=624116a0&colors=d6f3f7,ffffff,666666,117d6e';$content = file_get_contents($url);$part = '/<dl>\s*<dd\s*class="msg"><a\s*href="(.*?)"\s*target="_blank"><\/a>\s*<span\s*class="mbTxtB" >(.*?)<\/span><\/dd>/is';preg_match_all($part,$content,$arr) ;
    echo '<pre />';
    print_r($arr[1]);
    print_r($arr[2]);[/code]
      

  3.   

    谢谢楼上的,我发贴子后发现链接跑到上面去了,你可以误解了我的意思,
    我的意思是我如何根据一个新浪微博登陆用户名和密码获取到该用户的uid
      

  4.   

    用sina 的api 借口吧http://open.t.sina.com.cn/wiki/index.php/Users/show
      

  5.   

    API需要申请。如果没有,就模拟登陆,获取返回的header里的cookie即可。
    “SetCookie”字段后面,从“uid%3D”到“%26”之间的就是UID。