首页  >  文章  >  后端开发  >  php正则表达式提取html标签的有关问题

php正则表达式提取html标签的有关问题

WBOY
WBOY原创
2016-06-13 11:51:161283浏览

php正则表达式提取html标签的问题

<br /><tr><br />    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155319.aspx<br />" title="3月14日上海钢材市场价格汇总" target="_blank"><br />            	<font color="#0000FF"> 3月14日上海钢材市场价格汇总</font><br />        </a></td><br />    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td><br />  </tr><br />  <tr><br />    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155318.aspx<br />" title="3月14日北京钢材市场价格汇总" target="_blank"><br />            	<font color="#0000FF"> 3月14日北京钢材市场价格汇总</font><br />        </a></td><br />    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td><br />  </tr><br />  <tr><br />    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155317.aspx<br />" title="3月14日天津钢材市场价格汇总" target="_blank"><br />            	<font color="#0000FF"> 3月14日天津钢材市场价格汇总</font><br />        </a></td><br />    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td><br />  </tr><br />  <tr><br />    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155316.aspx<br />" title="3月14日重庆钢材市场价格汇总" target="_blank"><br />            	<font color="#0000FF"> 3月14日重庆钢材市场价格汇总</font><br />        </a></td><br />    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td><br />  </tr><br />  <tr><br />    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155315.aspx<br />" title="3月14日广州钢材市场价格汇总" target="_blank"><br />            	<font color="#0000FF"> 3月14日广州钢材市场价格汇总</font><br />        </a></td><br /><br />

我想获取所有

×××的标签中间的内容,应该怎么写正则表达式呢
------解决方案--------------------
<br />preg_match_all("/<td\s+Height=\"30\">(.*)<\/td>/iUs", $str, $output);<br />print_r($output);<br />
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn