<tr> <td Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155319.aspx" title="3月14日上海钢材市场价格汇总" target="_blank"> <font color="#0000FF"> 3月14日上海钢材市场价格汇总</font> </a> </td> <td align="Right"> <span class="biaotiriqi"> 3月14日</span> </td> </tr> <tr> <td Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155318.aspx" title="3月14日北京钢材市场价格汇总" target="_blank"> <font color="#0000FF"> 3月14日北京钢材市场价格汇总</font> </a> </td> <td align="Right"> <span class="biaotiriqi"> 3月14日</span> </td> </tr> <tr> <td Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155317.aspx" title="3月14日天津钢材市场价格汇总" target="_blank"> <font color="#0000FF"> 3月14日天津钢材市场价格汇总</font> </a> </td> <td align="Right"> <span class="biaotiriqi"> 3月14日</span> </td> </tr> <tr> <td Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155316.aspx" title="3月14日重庆钢材市场价格汇总" target="_blank"> <font color="#0000FF"> 3月14日重庆钢材市场价格汇总</font> </a> </td> <td align="Right"> <span class="biaotiriqi"> 3月14日</span> </td> </tr> <tr> <td Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155315.aspx" title="3月14日广州钢材市场价格汇总" target="_blank"> <font color="#0000FF"> 3月14日广州钢材市场价格汇总</font> </a> </td>
我想获取所有<td Height="30">×××</td>的标签中间的内容,应该怎么写正则表达式呢
$pattern = "/<td Height=\"30\">([\s\S]*)<\/td>/"; preg_match_all($pattern, $str, $matches); var_dump($matches);
测试可以通过
$pattern = "/<td Height=\"30\">([\s\S]*)<\/td>/"; preg_match_all($pattern, $str, $matches); var_dump($matches);
测试可以通过
规则改下
$pattern = "/<td Height=\"30\">([\s\S]*?)<\/td>/"
preg_match_all("/<td\s+Height=\"30\">(.*)<\/td>/iUs", $str, $output);print_r($output);以上就是php正则表达式提取html标签的问题的内容,更多相关内容请关注PHP中文网(www.php.cn)!
立即学习“PHP免费学习笔记(深入)”;
dompdf是一个HTML到PDF转换器。在其核心,dompdf是一个(大部分)符合CSS 2.1标准的HTML布局和渲染引擎,使用PHP编写。它是一个以样式驱动的渲染器,它会下载并读取外部样式表,内联样式标签和单个HTML元素的样式属性。它还支持大多数表现性HTML属性。PDF渲染目前由PDFLib或由Wayne Munro编写的捆绑版本的R&OS CPDF类提供。(对R&OS类进行了一些重要的更改,但是)。为了使用dompdf与PDFLib,需要安装PDFLib PECL扩展。使用PD
5
相关文章:
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号