我想在起始位置获取字符串中的 html 标记并将其从字符串中删除
我的演示字符串如下:
<I>little willingness</I> that, as the Course itself was to emphasise
这将返回 <I>
标记为 o/p
<p>little willingness</p> that, as the Course itself was to emphasise
这将返回 <p>
标记为 o/p
little willingness that, <p>as the Course itself was to emphasise</p>
这将返回 null 作为 o/p
如何修改下面的代码以仅检查行首的 HTML 标记,然后将其删除?
preg_match("/<[^<]+>/",$string,$m);