mhussein76
mhussein76

Reputation: 53

How can i retrieve the formated text from DB and display it in HTML using the PHP?

I have a form that has a field called post content, I am using WYSIWYG Editor to allow the end-user to format the text before saving it or update into the database. the problem that I am facing when it retrieves such content using echo like:

<p><?php echo $post_content ?></p>

it will be displayed like that to the end-user.

This <b>Course </b>is Wonderful. I encourage everyone to take it.

So how can i display the retrieved data correctly as per their formates?

Upvotes: 2

Views: 51

Answers (1)

Alex DeStefano
Alex DeStefano

Reputation: 237

Try this instead:

<p><?php echo htmlspecialchars_decode($post_content) ?></p>

Upvotes: 2

Related Questions