>  기사  >  백엔드 개발  >  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으로 문의하세요.