how can i get rid of newlines?

From: Date: Sat, 29 Nov 2003 02:24:35 +0000
Subject: how can i get rid of newlines?
Groups: php.general 
Request: Send a blank email to php-general+get-171309@lists.php.net to get a copy of this message
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!

« previous php.general (#171309) next »