RE: [PHP] formatting paragraphs in to strings
| From: | Murray @ PlanetThoughtful | Date: | Mon, 13 Jun 2005 19:37:33 +0000 |
| Subject: | RE: [PHP] formatting paragraphs in to strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216907@lists.php.net to get a copy of this message | ||
> Use the PHP str_replace function before writing it to the DB. Replace
> all "\n" characters with an empty string "".
>
> http://us2.php.net/manual/en/function.str-replace.php
I think it might be better to replace all "\n" characters with spaces " ",
otherwise you will end up with sentences that have no space break between
them.
Ie:
<original text>
This is the first sentence.
This is the second sentence.
</original text>
...would become:
<replaced text>
This is the first sentence.This is the second sentence.
</replaced text>
Regards,
Murray