how can i get rid of newlines?

From: David T-G (davidtg-php_at_justpickone.org)
Date: 11/29/03


Date: Fri, 28 Nov 2003 21:24:35 -0500
To: PHP General list <php-general@lists.php.net>


Hi, all --

As has been discussed before, the nl2br function doesn't actually convert
newlines to breaks but instead is more like "nl2nlbr". That is,

  input
  like
  this

becomes

  input
  <br>like
  <br>this

instead of

  input<br>like<br>this

as the name would indicate.

I need a true nl2br function to get rid of newlines; I am accepting a
changed ini file parameter but the newline kills me.

I tried

  $v = preg_replace("/\n/","<br>",$v) ;

but, even though $v had embedded newlines and wasn't merely a single line
of that input, it didn't work. If this were perl I'd think that perhaps
I'd change my record delimiter but I don't know how to do that in php.

Any ideas?

TIA & HAND

:-D

-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!