note 8575 deleted from nl2br by zak
| From: | zak@php.net | Date: | Sat, 30 Dec 2000 00:07:58 +0000 |
| Subject: | note 8575 deleted from nl2br by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9224@lists.php.net to get a copy of this message | ||
I was running into /n problems too.
I have forms with textarea (for adresses) that should be inserted into a mysql table.
I uses nl2br to manipulate the string before inserting it. It seemed to work fine, I could do a
select and the results looked the way they should.
But when I looked at the tables from the command prompt (mysql>) they looked UGLY, because there
was still the r command left in the string or whatever.
So the only way to solve it was
<pre>
$text = nl2br(text);
$text = ereg_replace("n", "", $text);
$text = ereg_replace("r", "", $text);
</pre>
Messy, I know, but it works.
Jan.