如果我们只有 URL 或嵌入代码,谁能告诉我如何显示或嵌入 YouTube 视频?
Can anyone give me an idea how can we show or embed a YouTube video if we just have the URL or the Embed code?
您必须要求用户存储来自 youtube 视频的 11 个字符的代码.
You have to ask users to store the 11 character code from the youtube video.
例如http://www.youtube.com/watch?v=Ahg6qcgoay4
十一个字符的代码是:Ahg6qcgoay4
The eleven character code is : Ahg6qcgoay4
然后您将这段代码放入您的数据库中.然后,无论您想将 YouTube 视频放置在页面中的哪个位置,从数据库中加载该角色并输入以下代码:-
You then take this code and place it in your database. Then wherever you want to place the youtube video in your page, load the character from the database and put the following code:-
例如对于 Ahg6qcgoay4,它将是:
e.g. for Ahg6qcgoay4 it will be :
<object width="425" height="350" data="http://www.youtube.com/v/Ahg6qcgoay4" type="application/x-shockwave-flash"><param name="src" value="http://www.youtube.com/v/Ahg6qcgoay4" /></object>
这篇关于如何在 PHP 中嵌入 YouTube 视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Zend 中的动作视图助手 - 解决方法?Action View Helper in Zend - Work around?(Zend 中的动作视图助手 - 解决方法?)
这是将 URI 与 PHP 中用于 MVC 的类/方法匹配的好方Is this a good way to match URI to class/method in PHP for MVC(这是将 URI 与 PHP 中用于 MVC 的类/方法匹配的好方法吗)
我在哪里保存 Zend Framework 中的部分(视图),以便Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(视图),以
有一个网站的单一入口点.坏的?好的?没问题?Having a single entry point to a website. Bad? Good? Non-issue?(有一个网站的单一入口点.坏的?好的?没问题?)
MVC + 服务层在 Zend 或 PHP 中常见吗?Is MVC + Service Layer common in zend or PHP?(MVC + 服务层在 Zend 或 PHP 中常见吗?)
PHP MVC 方法中的 Hello World 示例Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)