[PHP] Textarea returns causing havoc

2001-05-09 Thread Sam

Hi all, 

I have a web form in which users can type their comments into a text area
field.
This is ok apart from when the users hit a return.
As this creates a new line...
Is there anyway in which I can get rid of this:-

Hi
My name is
Sam Rose

into this:

Hi my name is Sam Rose

I have tried

nl2br()
str_replace()

but these do not seem to get rid of the returns.

What can I do?

Thanks in advance.

Also could you please reply to me and the list as I am only on the digest
list,

Sam Rose

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Textarea returns causing havoc

2001-05-09 Thread Rares

Here is how i do it, and it works:

$tmp_desc = str_replace(\t,  , str_replace(\n,  , str_replace(\r,
 , $desc)));
$desc = $tmp_desc;

\t for stipping TABs also

- Original Message -
From: Sam [EMAIL PROTECTED]
Subject: [PHP] Textarea returns causing havoc


 Hi all,
 into this:

 Hi my name is Sam Rose

 I have tried
 nl2br()
 str_replace()



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]