0
我正在使用file_get_contents
来读取.html
有一个表的文件。这个preg_match_all有什么问题
<table id="someTable" style="width:100%;margin-bottom:0;">
<tr style="display:none;">
<td style="padding-left:25px;">Some text</td>
</tr>
<tr style="display:none;">
<td style="padding-left:25px;">another text</td>
</tr>
</table>
当我使用preg_match_all读取表,我什么也没得到,当我数$matches[1]
preg_match_all('/<table id="someTable" style="width:100%;margin-bottom:0;">(.*)<\/table>/', $html, $matches);
$co = count($matches[1]);
寻找用正则表达式解析HTML是几乎可以肯定不是要走的路。你想要达到什么目标? – lonesomeday