-1
我找PHP中的正則表達式,其切串在第一(<br>|<br />|<p>)
正則表達式切割字符串
我有這樣的事情,但它仍然沒有工作
$newstring = preg_replace('#< /?\s*(br|p) >.*$#i', '', $string);
例如,如果$string
是:
<b>this is a test</b><bR>and it is going on<br /> and so on<p>
期待$newstring
是
<b>This is s test</b>
提供一個樣本輸入端和所希望的輸出是非常讚賞。 – revo