br2nl Replace All XHTML/HTML Line Breaks with Newlines in PHP

Posted by markb on Stack Overflow See other posts from Stack Overflow or by markb
Published on 2010-03-12T21:51:57Z Indexed on 2010/03/12 22:17 UTC
Read the original article Hit count: 293

Filed under:
|
|
|

I am looking for the best br2nl function. I would like to replace all instances of <br> and <br /> with newlines \n. Much like the nl2br function but the opposite.

I know there are several solutions in the PHP manual comments but I'm looking for feedback from the SO community on possible solutions.

© Stack Overflow or respective owner

Related posts about php

Related posts about regex