-1

I am new in PHP and I have wysihtml5 editor in my form and when I am adding iframe code in editor to store value into database iframe code encoded like:

&lt;iframe width="560" height="315" src="<a target="_blank" rel="nofollow" href="http://www.youtube.com/embed/ycHXRWRKrdA?rel=0&quot;">http://www.youtube.com/embed/ycHXRWRKrdA?rel=0"</a>; frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;<br>

I want to store iframe code like below

<iframe width="560" height="315" src="http://www.youtube.com/embed/ycHXRWRKrdA?rel=0" frameborder="0" allowfullscreen></iframe>

Any idea?

Artjom B.
  • 58,311
  • 24
  • 111
  • 196
Mr.Happy
  • 477
  • 1
  • 7
  • 20
  • 1
    Which wysiwyg editor is it? You should not add HTML code in WYSIWYG mode in it. Almost all wysiwyg editors have "Source" button where you can edit the HTML itself, and it DOES save a normal HTML, not the &tags; – Oleg Dubas May 23 '17 at 15:55
  • @OlegDubas I am using bootstrap wysiwyg editor. – Mr.Happy May 23 '17 at 16:05
  • 1
    @300988 Bootstrap doesn't have an official WYSIWYG editor, so it'd be good if you could link the specific one. – ceejayoz May 23 '17 at 17:46

1 Answers1

-1

you should apply http://php.net/manual/en/function.htmlspecialchars-decode.php to your string when is saved or when is displayed

Eduard Void
  • 2,359
  • 12
  • 12