note 9586 deleted from function.nl2br by aidan
| From: | aidan@php.net | Date: | Sun, 10 Oct 2004 10:40:30 +0000 |
| Subject: | note 9586 deleted from function.nl2br by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78293@lists.php.net to get a copy of this message | ||
Note Submitter: php at fendforyourself dot com
----
[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().