【发布时间】:2012-03-26 11:48:23
【问题描述】:
我的输出是这样的:
<img src="location-of-image.png" style="width:100px;height:100px" title='smpl'/>
<p>sampe sample sampple</p><br />when? how?.
我的问题是我只想得到
<img src="location-of-image.png" style="width:100px;height:100px;" title='smpl'/>
并删除
<p>sampe sample sampple</p><br />when? how?.`
所以我的预期输出应该只是这样:
<img src="location-of-image.png" style="width:100px;height:100px;" title='smpl'/>
我将如何在 PHP 中做到这一点? 我知道这在 javascript/jquery 中更容易完成,但我想要在 PHP 中。
【问题讨论】:
-
img标签是输入字符串的第一个标签吗?
-
你的标签总是分成两行吗?