Populating Data into textArea - shows HTML

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
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Populating Data into textArea - shows HTML

Post by arunkar »

Hi guys,

When the data from the from the textArea is stored into the database in the "text" field. the paragaphs have <br /> in them.
When the data is populated into a textArea it has the <br/> tag in it. How do I remove it? is there a way to overcome this?

The data entered into the textArea
The future is not somewhere we are going. It is something we are creating. Every day we do things that make some futures more probable and others less likely.

Global warming already disrupts millions of lives daily in the forms of destructive weather patterns and loss of habitat.


The data populated into the textArea
The future is not somewhere we are going. It is something we are creating. Every day we do things that make some futures more probable and others less likely.<br />
<br />
Global warming already disrupts millions of lives daily in the forms of destructive weather patterns and loss of habitat.<br />
<br />



How do I display with the HTML tags? any ideas ppl?

thanks
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Populating Data into textArea - shows HTML

Post by jaoudestudios »

Are there 2 questions or have you contridicted yourself?

To remove html tags use strip_tags and to put <br> or <br /> back in from line breaks in the textarea using nl2br.
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Re: Populating Data into textArea - shows HTML

Post by arunkar »

there was just one question...

strip_tags did the trick

thank you
Post Reply