假设我有以下源输出:
<p>This is first paragraph</p> <p>This is second paragraph</p> <p>This is third paragraph</p>
我想要达到的是。。。我想把它们分开,第一段变成一个变量,其他的变成另一个变量。比如:
$first = "<p>This is first paragraph</p>"; $next = "<p>This is second paragraph</p><p>This is third paragraph</p>";
<br /> 或其他标记,这将导致TinyMCE生成新的代码中断 \r\n . 因此,所有的解决方案都是通过寻找 \\r\n 这次不行了。
<br />
\r\n
\\r\n
有什么建议吗?
试试这个:
$input = str_replace('</P>', '</p>', $input); # In case of upper case tags list($first, $next) = explode('</p>', $input, 2); $first .= '</p>';