Is it possible to remove ambiguous whitespace from a string containing html with HTMLPurifier? I wasn't able to find anything relevant in the documentation. I'm also open to other methods if they exist.
Example Input:
Test Line1
<p>
Test Line2</p>
<p>
Line 3</p>
Optimal Output:
Test Line1<p>Test Line2</p><p>Line 3</p>
Thanks开发者_运维百科!!!!!!
Can regular expression help?
$text = preg_replace('/\s+/u', '', $text)
精彩评论