Home >Backend Development >PHP Tutorial > 求一PHP正则表达式

求一PHP正则表达式

WBOY
WBOYOriginal
2016-06-13 13:06:55818browse

求一PHP正则表达式,在线等


正则提取出table或tr标签,如:
,标签属性不固定,有多少就要多少,

在线等,谢谢

------解决方案--------------------
preg_match_all再用str_replace
------解决方案--------------------
PHP code
$str =<tr><td><div> </div></td></tr><tr style='"display:block;"'></tr><tr style="display:block;">
eof;
preg_match_all('#]+(?=")[^>]+>#is',$str,$m); 
print_r($m[0]); <div class="clear">
                 
              
              
        
            </div>
</tr>
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