php关于视频方面的问题

WBOY
Release: 2016-06-23 13:48:03
Original
792 people have browsed it

我最近做一个视频网站, 需要视频能播放的时间是固定的时间段才能播放,比如说一个视频只能在6点到8点之间播放,其余时间段播放不了,  如果要实现这个功能的话, 是需要判断时间戳还是用权限管理来做呢, 能不能给点思路, 谢谢了~~


回复讨论(解决方案)

用date("H",time())获取小时(24制),再比对在6到8之间就可以播放,否者不能播放

demo

$hour = date('H');if($hour>=6 && $hour<8){    echo '<iframe height=498 width=510 src="http://player.youku.com/embed/XNzk5MDE1MTA4" frameborder=0 allowfullscreen></iframe>';}else{    echo 'Play time is 06:00~08:00';}
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!