note 8070 deleted from trim by jmcastagnetto

From: Date: Sun, 10 Sep 2000 02:55:02 +0000
Subject: note 8070 deleted from trim by jmcastagnetto
Groups: php.notes 
Request: Send a blank email to php-notes+get-4637@lists.php.net to get a copy of this message
Here's a function that will replace the new line with a {BR} UNLESS a {BR} is already present... (substitute less-than and greater-than and around the {BR} ) function replace_nl($string) { // cut the value up by n's $lines = explode (" ", $string); $index=0; while($lines[$index]) { $lines[$index] = trim($lines[$index]); if(substr($lines[$index], strlen($lines[$index]) - 4, 4) != "{br}") $lines[$index] .= "{br}"; $return_result .= $lines[$index]; $index++; } return $return_result; }

« previous php.notes (#4637) next »