Sia Sia - 1 year ago 71
PHP Question

How can I match \n\r with preg_replace in php

I want to remove the empty paragraphs in html:


can't match this
while use
works, why?

Answer Source

When you need a new line, \r (return) comes before \n (new), so in your expression you should use \r\n.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download