如何将youtube嵌入链接存储在数据库中 [英] how do I store a youtube embed link in a database

查看:117
本文介绍了如何将youtube嵌入链接存储在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将youtube嵌入的iframe保存到我的数据库中时,在我回忆起它时会添加一串斜线.像下面这样.

When I save a youtube embed iframe into my database it adds a bunch of slashes when i recall it. Like so below.

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

它以长文本类型存储.当我从数据库中调用斜线时会删除斜线,或者阻止斜线存储在第一位的方式是什么

its is being stored in a longtext type. what would remove the slashes when I recall it from the database or prevent slashes being stored in the first place

推荐答案

如果使用PHP,则可以使用stripslashes().

if you use PHP, you can use stripslashes().

或者,您也可以对代码进行base64编码/解码.

Alternatively you can base64 encode / decode the code.

这篇关于如何将youtube嵌入链接存储在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆