BR2NL Function - Opposite of NL2BR

Submitted by:Pitter Alderson

Date added:18 August, 2014

Category:PHP

Simple way to do the opposite of what the nl2br() function does- turns breaks () into new lines.

Tags: php function , br2nl , nl2br

Code Snippet:

FUNCTION br2nl($string){
RETURN PREG_REPLACE('#<br\s*?/?>#i', "\n", $string);
}
 
 

Comments