0

I have a table in database. this table has one field which consist raw html data below format:

<iframe width="475" height="271" src="http://www.youtube.com/embed/GcUYa4_1aYs?rel=0&amp;hd=1" frameborder="0" allowfullscreen></iframe>

when I am fetching the data from database its rendering the html code. I want to just show as it is(Raw html) in PHP without rendering. how can i display it? when i am showing that, its just rendering the data from database.

sumitjainjr
  • 741
  • 1
  • 8
  • 28

2 Answers2

1

You can use htmlentities or use single quote '', this is a very good SO question and answer on difference in php between single and double quotes.

Community
  • 1
  • 1
Ende Neu
  • 15,581
  • 5
  • 57
  • 68
0

Use htmlentities($your_html_code); It is your safest bet, it does what htmlspecialchars() does, and more.

viiq
  • 35
  • 9