phpdeveloper
phpdeveloper

Reputation: 93

html encoding with php

I have an issue. I have a column in mysql database like

<p><strong>WELCOME</strong></p>
<p><strong>About Me</strong>

Now I want to fetch this in my php page. But when I am fetching, it doesn't show bold text, only normal text. I am using

html_entity_decode($content,0,1649)."...");

Upvotes: 0

Views: 93

Answers (1)

Brad
Brad

Reputation: 163612

It sounds like what is happening is that you have some other code that is escaping your data prior to being output for HTML.

This is a good thing in most cases. You don't want HTML with <script> tags and what not being allowed in your data from users. If anything, you don't want < and > to be misinterpreted.

However, if you do want to allow HTML, you need to modify whatever is outputting your HTML to not escape this particular variable.

Upvotes: 1

Related Questions