Re: preg_replace help

From: Date: Tue, 26 Jan 2010 13:36:25 +0000
Subject: Re: preg_replace help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-301470@lists.php.net to get a copy of this message
Michael A. Peters wrote on 26/01/2010 14:18:
$fixSrch[] = '/\n/'; $fixRplc[] = '[br]'; is what I need except I want it to leave anything between [code] and [/code] alone. I figured it out before but with <element> </element> but I don't even remember what I was working on when I did that and I can't for the life of me find it now.
Just use the function nl2br() If you wanna match "\n", you need to add a backslash before the backslash: "\\n" -- Kind regards Kim Emax - masterminds.dk

« previous php.general (#301470) next »