note 9586 modified in nl2br by jmcastagnetto

From: Date: Tue, 14 Nov 2000 06:56:53 +0000
Subject: note 9586 modified in nl2br by jmcastagnetto
Groups: php.notes 
Request: Send a blank email to php-notes+get-7656@lists.php.net to get a copy of this message
[Editor's note: Ehem, there *is* a way to reverse htmlspecialchars(), look at the manual entry for get_html_translation_table(). Also a simple str_replace()/ereg_replace()/preg_replace() would do the "<br>" to "\n" conversion] Someone asked why there was no br2nl(). I think it's probably in most cases you want to take your data and display it in HTML, so it is probably already stored with the \n. Storing it with the <br>'s instead would just take up extra space and there's no point in doing that when you can always convert it on display. I'm assuming this is the same reason there is no built in reverse to htmlspecialchars(). http://www.php.net/manual/function.nl2br.php

« previous php.notes (#7656) next »