PHP – br2nl
As a reverse function of nl2br you can use: <?php /** * reverse function for nl2br * @param $string – string with br’s * @return string – string with \n */ function br2nl($string) { return preg_replace(‘/\<br(\s*)?\/?\>/i’, “\n”, $string); } ?>