Simple String Replace Question

From: Date: Sun, 25 Feb 2001 18:37:05 +0000
Subject: Simple String Replace Question
Groups: php.general 
Request: Send a blank email to php-general+get-41595@lists.php.net to get a copy of this message
I would like to get rid of \n characters unless there are two or more in a row. So for example if there is a long email formatted like we do here with line break I want to remove the line breaks so text can be wrapped by a browser, but also show paragraph breaks where necessary. This is what I have: $string_new = str_replace("\n", "", $string); How can I augment this to not replace: \n \n Thanks. Jeff Oien

« previous php.general (#41595) next »