user9880780
user9880780

Reputation:

How to remove html tags from a text with PHP

I have retrieved some data from my MySQL database table in a text area field:

<textarea class='sendDesc insert' name='blog_body' placeholder='".$blogReturn->GetBlogBody()."'></textarea>

And it shows this as result:

print screen

Now what I want to do is to remove the html tags such as <p> tags from this text. So only the text will show on screen .. (with the applied css settings).

So how can I do that?

Upvotes: 0

Views: 99

Answers (1)

Devsi Odedra
Devsi Odedra

Reputation: 5322

use strip_tags()

echo strip_tags("Hello <p>world!</p>");

Upvotes: 1

Related Questions