Maison  >  Article  >  développement back-end  >  正则在软件中通过,但是在php中不可用,怎么解决

正则在软件中通过,但是在php中不可用,怎么解决

WBOY
WBOYoriginal
2016-06-13 13:13:42773parcourir

正则在软件中通过,但是在php中不可用,如何解决

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><?php //$code=file_get_contents('http://wvw.ranwen.com/info_24983.html');
$code=file_get_contents('http://wvw.ranwen.com/info_41974.html');
if (preg_match('/<div id="CrbsSum">.*<br>\s*((.|\n)+?)/i', $code,$tmp)){
    print_r($tmp);
}else{
    echo 'wasd';
}

如上代码 注释第一个链接使用第二个的时候无法使用,但是当注释第二个使用第一个的时候可以,求助这是什么原因

------解决方案--------------------
在我这运行,看他们的运行效果都是一样的。貌似没有差别。
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn