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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:11:491431browse

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

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

//内容

</table>
</code>

回复内容:

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

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

//内容

</table>
</code>

<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>

<code>preg_match('/<table.>(.*?)/s',$str,$match);</table.></code>
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