<tr>
<td>
·<a title="3月14日上海钢材市场价格汇总">
<font> 3月14日上海钢材市场价格汇总</font>
</a>
</td>
<td>
<span> 3月14日</span>
</td>
</tr>
<tr>
<td>
·<a title="3月14日北京钢材市场价格汇总">
<font> 3月14日北京钢材市场价格汇总</font>
</a>
</td>
<td>
<span> 3月14日</span>
</td>
</tr>
<tr>
<td>
·<a title="3月14日天津钢材市场价格汇总">
<font> 3月14日天津钢材市场价格汇总</font>
</a>
</td>
<td>
<span> 3月14日</span>
</td>
</tr>
<tr>
<td>
·<a title="3月14日重庆钢材市场价格汇总">
<font> 3月14日重庆钢材市场价格汇总</font>
</a>
</td>
<td>
<span> 3月14日</span>
</td>
</tr>
<tr>
<td>
·<a title="3月14日广州钢材市场价格汇总">
<font> 3月14日广州钢材市场价格汇总</font>
</a>
</td>
<p>我想获取所有</p>
<td height="30">×××</td>的标签中间的内容,应该怎么写正则表达式呢<h2>回复讨论(解决方案)</h2>
<pre class="brush:php;toolbar:false">$pattern = "/<td>([\s\S]*)/";
preg_match_all($pattern, $str, $matches);
var_dump($matches);<p>测试可以通过</p>
<pre class="brush:php;toolbar:false">$pattern = "/<td>([\s\S]*)/";
preg_match_all($pattern, $str, $matches);
var_dump($matches);<p>测试可以通过 <br>规则改下 </p>
<pre class="brush:php;toolbar:false">$pattern = "/<td>([\s\S]*?)/"
preg_match_all("/</td><td>(.*)/iUs", $str, $output);print_r($output);<p>以上就是php正则表达式提取html标签的问题的内容,更多相关内容请关注PHP中文网(<a href="http://www.php.cn%EF%BC%89%EF%BC%81">www.php.cn)!</a></p>
<p>相关文章:</p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/xiazai/skill13222" title="Build MCP servers and clients for PHP applications with the official PHP SDK"><img
src="https://img.php.cn/upload/skill/001/246/273/6adaf20e352aa140.jpg" alt="Build MCP servers and clients for PHP applications with the official PHP SDK" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/xiazai/skill13222" title="Build MCP servers and clients for PHP applications with the official PHP SDK" class="overflowclass">Build MCP servers and clients for PHP applications with the official PHP SDK</a>
<p class="overflowclass">使用官方Model Context Protocol PHP SDK将PHP应用程序功能暴露为MCP工具、资源和提示,用于代理工作流。</p>
</div>
<a rel="nofollow" href="/xiazai/skill13222" title="Build MCP servers and clients for PHP applications with the official PHP SDK" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div>
<p><a href="http://www.php.cn/php-weizijiaocheng-315894.html" target="_self">提取html标签的php代码示例</a></p>
<p><a href="http://www.php.cn/php-weizijiaocheng-76526.html" target="_self">通过php提取HTML标签</a></p>
<p><a href="http://www.php.cn/php-weizijiaocheng-298770.html" target="_self">php 正则表达式提取图片url程序</a></p>
</td>
php免费学习视频:立即使用
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!










