ytd*_*tdm 2 php newline paragraph
如何替换<p>hello</p> <p>world</p>为hello<br />world <br />
我尝试在堆栈上搜索,但没有匹配的结果。
小智 5
您可以通过使用str_replace()函数来实现。
例如:
$string = "<p>hello</p> <p>world</p>";
$string = str_replace('<p>', '', $string);
$string = str_replace('</p>', '<br />' , $string);
Run Code Online (Sandbox Code Playgroud)