网址:http://php.vip.blog.163.com/blog/static/20188394220123774015726/我想从上面的网址中 找出是否有"@jobour#[email protected]"这样的字符串,如下是我的程式,不知道有没有更快的方法,谢谢~
$arr = file_get_contents('http://php.vip.blog.163.com/blog/static/20188394220123774015726/');
$patten = '/@jobour#[email protected]/';
$match = preg_match($patten,$arr);
$match ? echo '成功' : echo '失败';

解决方案 »

  1.   

    如果想获取网页中的某个字段,有没有更好的方法,帮忙写下。THS. 以我提交的链接为准看看。
      

  2.   

    根本不是正则问题,直接strstr才叫快。
      

  3.   

    file_get_contents如果是网络问题,会出现Warning: file_get_contents(http://www.baidu.com/) [function.file-get-contents]: failed to open stream: 怎么设置如果FAIL了继续执行啊。
      

  4.   

    file_get_contents如果是网络问题,会出现Warning: file_get_contents(http://www.baidu.com/) [function.file-get-contents]: failed to open stream: 怎么设置如果FAIL了循环执行