Home  >  Article  >  Backend Development  >  一个正责

一个正责

WBOY
WBOYOriginal
2016-06-13 10:12:11808browse

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

要得到这一段内容必须要 用 或者 连接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>
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