Home  >  Article  >  Backend Development  >  php正则表达式提取html标签的有关问题

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

WBOY
WBOYOriginal
2016-06-13 11:51:161282browse

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