note 21031 added to function.nl2br

From: Date: Thu, 25 Apr 2002 19:57:02 +0000
Subject: note 21031 added to function.nl2br
Groups: php.notes 
Request: Send a blank email to php-notes+get-29856@lists.php.net to get a copy of this message
In reference to s_vunckx@hotmail.com's problem -- I gather that you are experiencing the < br /> multiplying effect when modifying content that has previously passed through a nl2br(). Just use a strip_tags() on the variable/text that you are attempting to modify, before it reaches the browser form field in which it will display. This will remove all <br /> tags prior to viewing in the browser form field (however, corresponding newlines and returns will still be there). Then, simply pass the same var through another nl2br() prior to sending the var back to your database or textfile. -- http://www.php.net/manual/en/function.nl2br.php http://master.php.net/manage/user-notes.php?action=edit+21031 http://master.php.net/manage/user-notes.php?action=delete+21031 http://master.php.net/manage/user-notes.php?action=reject+21031

« previous php.notes (#29856) next »