思路是?需要具备哪些知识呢?

解决方案 »

  1.   

    获取网页的源代码(比如:curl、fsockopen、file_get_contents)+正则
      

  2.   

    记得在php100看到过一个正则视频教程,楼主可以去找找!
      

  3.   

      <?php
    if(@$_POST['button']!=""){

    $content=$_POST['content'];$url="$content";
    @$fp=fopen($url,"r") or die("输入有误,输入格式如:http://t.sina.com.cn/caiwensheng");
    $fcontents=file_get_contents($url);
    @eregi("<title>(.*)</title>",$fcontents,$rg);//截取内容echo $rg[1];
    echo $rg1[1];
    if($rg[1]==false){
    echo "<script>alert('请先登录微博后再查询!');</script>";
    echo "<script>window.location.href='http://t.sina.com.cn/'</script>";

    }
    }
    ?>