Home > Backend Development > PHP Tutorial > 正则表达式 - 求php正则匹配table标签

正则表达式 - 求php正则匹配table标签

WBOY
Release: 2016-06-06 20:11:49
Original
1399 people have browsed it

table里面所有的内容都不要过滤掉,包括标签和内容。

<code><table id="Table1" class="blacktab" bordercolor="Black" border="0" width="100%">

//内容

</table>
</code>
Copy after login
Copy after login

回复内容:

table里面所有的内容都不要过滤掉,包括标签和内容。

<code><table id="Table1" class="blacktab" bordercolor="Black" border="0" width="100%">

//内容

</table>
</code>
Copy after login
Copy after login

<code>preg_match("/<table>]*?>(.*?)/s",$html,$match);

print_r($match[1]);

                            
            <p class="answer fmt" data-id="1020000004944935">
                                    </p>
<pre class="brush:php;toolbar:false"><code><?php $s = file_get_contents('./table.html');
preg_match('/<table[^>]*>(.*)/is', $s, $arMatch);
var_export($arMatch);
?></code>
Copy after login

<code>preg_match('/<table.>(.*?)/s',$str,$match);</table.></code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template