CodeIgniter Forums
How to store Youtube embed code in DB? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: How to store Youtube embed code in DB? (/thread-34784.html)



How to store Youtube embed code in DB? - El Forum - 10-09-2010

[eluser]shinokada[/eluser]
I would like to store Youtube embed code in the database so that it will show up in a front-end page.

However when I do it in CI, it stores tags etc with escaped, like & g t ; etc.

When I use < h1 > etc, it displays h1.

How can I store Youtube embed code in DB?

Thanks in advance.


How to store Youtube embed code in DB? - El Forum - 10-09-2010

[eluser]JHackamack[/eluser]
You can try htmlspecialcharacters_decode:
http://www.php.net/manual/en/function.htmlspecialchars-decode.php
before echoing out your youtube embed codes.