Return to Snippet

Revision: 22453
at January 13, 2010 01:43 by giak


Initial Code
// Extend nl2br PHP : only ONE <br/>
function neo_replace_nl2br($texte){
	$pattern     = '/<br\s*\/>([\n\s]*<br\s*\/>)+/si';
	$replacement = '<br/>';
	$v_texte     = preg_replace($pattern, $replacement,nl2br($texte));
	return $v_texte;
}

Initial URL
http://www.giacomel.fr

Initial Description

                                

Initial Title
PHP : Extend nl2br : only ONE

Initial Tags

                                

Initial Language
PHP