【发布时间】:2016-05-24 06:22:01
【问题描述】:
我有一个 Magento 网站,其中每个产品的描述字段中都有一个锚标记,例如 <a href="link">Content</a>。
现在我想删除这个锚标签以及它在标签内的内容,但保持其余描述不变。
现在的示例描述如下:
<ul>
<li>Cylinder head has been assembled to OEM specifications with using all new components like Cam shaft, valves and/or springs, buckets, shims etc. where applicable.</li>
<li>
<a href="http://sampledomain.com/media/wysiwyg/folder/file.pdf">All heads we supply pass through 24 points of quality check program.</a>
</li>
<li>Warranty: 1 year or 20,000 Kms factory warranty.</li>
<li>
<b>Kit Includes:</b>
</li>
<li>Fully assembled cylinder head</li>
<li>VRS (Vehicle regrind set)</li>
<li>Head gaskets (thickest grade)</li>
<li>Head bolts</li>
<li>Warranty card</li>
</ul>
现在我希望它显示如下:
<ul>
<li>Cylinder head has been assembled to OEM specifications with using all new components like Cam shaft, valves and/or springs, buckets, shims etc. where applicable.</li>
<li>
</li>
<li>Warranty: 1 year or 20,000 Kms factory warranty.</li>
<li>
<b>Kit Includes:</b>
</li>
<li>Fully assembled cylinder head</li>
<li>VRS (Vehicle regrind set)</li>
<li>Head gaskets (thickest grade)</li>
<li>Head bolts</li>
<li>Warranty card</li>
</ul>
如何使用更新查询来做到这一点?
【问题讨论】:
-
每个产品只包含一个锚标签还是多个?
-
展示一个真实的样本和你需要的结果..
-
每个产品描述只有一个锚标签。更新我的问题以添加描述。
-
有些任务最好留给应用程序代码,而不是 SQL。
标签: html mysql sql regex magento