RE: [PHP] Removing Returns / New Lines / Tabs / Extra Spaces from DB Results
| From: | Jami | Date: | Thu, 08 May 2003 16:18:47 +0000 |
| Subject: | RE: [PHP] Removing Returns / New Lines / Tabs / Extra Spaces from DB Results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146869@lists.php.net to get a copy of this message | ||
Ken Tozier's answer worked perfectly.
$cleaned_string = preg_replace("/[\s]+/"," ",$original_string);
Thanks Ken and Brent for responding back.
----------
Jami Moore
jami@jamisniche.com
http://designsby.jamisniche.com/
-----Original Message-----
From: Brent Baisley [mailto:brent@landover.com]
Have you looked at the addslashes() function?
On Wednesday, May 7, 2003, at 10:37 PM, Jami wrote:
> I have a form with a textarea that allows for description and people
> can
> put in returns. How can I remove the returns once the content has
> already been submitted to the database prior to writing the
information
> to a tab delimited text file? I have tried trim, ltrim, rtrim, and
> eregi_replace to remove \n, \r, and \t, but it has not worked.