note 10364 added to nl2br

From: Date: Fri, 29 Dec 2000 19:48:12 +0000
Subject: note 10364 added to nl2br
Groups: php.notes 
Request: Send a blank email to php-notes+get-9182@lists.php.net to get a copy of this message
I also had a problem where the return of a variable using n2blr would stop at a single quote. The following input ------------------- It is Jim's job to work with PHP ------------------- Would show up as this --------------------- It is Jim --------------------- So, I added this line to my n2blr code $variable = ereg_replace("'", "'", $variable); /* ' is for the single quote */ So that the full code is; $variable = nl2br($variable); $variable = ereg_replace("\n", "", $variable); $variable = ereg_replace("\r", "", $variable); $variable = ereg_replace("'", "'", $variable); There may be a better way to do this, but so far, this has worked fine for me. http://www.php.net/manual/function.nl2br.php

« previous php.notes (#9182) next »