php - YouTube URL iframe问题

标签 php html string iframe youtube

我正在尝试使用来自我的php的字符串加载,youtube IFrame,我知道该字符串获取的是视频网址,但是当放入html时,视频将无法加载。

我尝试过的方法。该URL是完整的youtube URL,没有缩短。

<iframe width="560" height="315" src="<?=$purl?>" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="<?=$_SESSION['theurl']?>" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="<?$purl?>" frameborder="0" allowfullscreen></iframe>

也许我做错了吗?我也尝试了旧的对象方法,但结果仍然相同。

最佳答案

如果您要将YouTube链接设置为iframe src,则它应如下所示:
http://www.youtube.com/embed/bFXb9F

关于php - YouTube URL iframe问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7769463/

相关文章:

HTML 背景固定位置

html - 在 Bootstrap 中以一定的精度将图像彼此重叠放置

regex - Powershell中的路径和字符串斩波

regex - Bash 正则表达式在句子中查找特定单词

php - 一个输入的多图像上传 PHP 表单

php - PHP shell_exec 中的 FFMPEG 命令对于 300Mo mp4 来说太慢了

php - 获取mysql中部分填充的数据

PHP list() 警告案例

html - 无法使用 aria 仅使用键盘输入显示下拉复选框

Python 字符串模式