RE: formatting paragraphs in to strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux