Last active
December 23, 2015 09:48
-
-
Save YuriDan/ae26a6244675d71804ee to your computer and use it in GitHub Desktop.
Доступность видео на Youtube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isAvailableVideo($videoId) { | |
$headers = get_headers('http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v='.$videoId.'&format=json'); | |
return (substr($headers[0], 9, 3) !== '404'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment