【发布时间】:2019-03-12 03:07:43
【问题描述】:
我有来自包含图像和文本的数据库的结果。我想删除第一张图片。
例子:
$string = 'This is some text and images
<img src="http://linktoimage" border="0">,
more text and <img src="http://linktoanotherimage"> and so on';
我想删除第一张图片,它并不总是相同的 url。
感谢您的帮助。
【问题讨论】:
-
因为你的字符串实际上是正则的,你可以用一个简单的正则表达式来完成。请尝试一下,如果/当您遇到困难时,请发布您到目前为止所写的内容。
标签: php