Removing blank spaces in textarea

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
srirams
Forum Commoner
Posts: 36
Joined: Wed May 25, 2005 8:57 am
Location: India
Contact:

Removing blank spaces in textarea

Post by srirams »

Hi,

I want to remove blank lines in a text area. That is when I submit a form if he enters a enter in the text area, it comes as a blank text. I want remove this black line.

Warne is the best.
Murli comes second.

should come as warne is the best and murli is the second.

Regards
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

try this

Code: Select all

echo str_replace("\n", " ", $string);
Post Reply