Re: preg_replace help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux