problems with replacing line breaks

From: Date: Fri, 01 Mar 2002 15:11:51 +0000
Subject: problems with replacing line breaks
Groups: php.general 
Request: Send a blank email to php-general+get-86768@lists.php.net to get a copy of this message
I'm trying to replace line breaks with html code and am having problems. For single lines preg_replace("/\n/","<br>",$text) or ereg_replace("\n","<br>",$text) adds the <br> but doesn't remove the line break. While preg_replace("/\n\n/","<p>",$text) doesn't find any double line breaks, even though they're there. Why doesn't this work? _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

« previous php.general (#86768) next »