Heim  >  Artikel  >  Backend-Entwicklung  >  php正则表达式提取html标签的有关问题

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

WBOY
WBOYOriginal
2016-06-13 11:51:161283Durchsuche

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 />
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn