Home  >  Article  >  Backend Development  >  php怎么进行正则匹配

php怎么进行正则匹配

WBOY
WBOYOriginal
2016-06-13 13:21:521017browse

php如何进行正则匹配
如何使用php正则匹配,匹配下面这个连接中 “股票走势”后的“较强”这几个字,
http://stockapp.finance.qq.com/doctor/sh600209.html

------解决方案--------------------

PHP code
$s=file_get_contents('http://stockapp.finance.qq.com/doctor/sh600209.html');
preg_match('/<span>([^股票走势)/s',$s,$m);
echo  $m[1]; <div class="clear">
                 
              
              
        
            </div></span>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn