0

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)."...");
6
  • Why are you HTML-encoding on storage? Commented Jan 7, 2013 at 4:17
  • I agree with @IgnacioVazquez-Abrams and check your encoding types from your database. Commented Jan 7, 2013 at 4:19
  • Even if I am using <span style="font-weight:bold"> instead of <strong> tag then it works. Commented Jan 7, 2013 at 4:19
  • I removed the htmlentities also now. But still not working. By the way how to check the encoding type in DB and what should be it? Commented Jan 7, 2013 at 4:22
  • 2
    @Daya That is not helpful. The <strong> tag is the correct way of embolding text. Commented Jan 7, 2013 at 4:24

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.