>  기사  >  백엔드 개발  >  一个正责

一个正责

WBOY
WBOY원래의
2016-06-13 10:12:11809검색

求助一个正责
我要匹配一段内容

要得到这一段内容必须要 用 或者 连接2个匹配前的字符串。但是我不知道怎么联



HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    <th class="left">股市名称</th>    <th>最新</th>    <th>涨跌幅%</th>   td class='left' width='72'>     <div>纳斯达克</div>


上面是内容,
现在我要得到
股市名称 最新 涨跌幅% 纳斯达克

我写了一个正责:
preg_match_all('/]*>| (.*)/isU', $value,$strs);

但是不能用。
还请看一看。




------解决方案--------------------
PHP code
$value=股市名称    <th>最新</th>    <th>涨跌幅%</th>   <td class="left" width="72">     <div>纳斯达克</div>
</td>html;preg_match_all('/(<th>]*>|<div>)(.*)(|)/isU', $value,$strs);     print_r($strs[2]);<div class="clear">
                 
              
              
        
            </div>
</div>
</th>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.