Last active
July 12, 2017 09:35
-
-
Save sargunv/a3bbb4e9e9052f179c15 to your computer and use it in GitHub Desktop.
Validate a YouTube video ID
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
<?php function validate_youtube($videoid) { return strpos ( get_headers ( "http://gdata.youtube.com/feeds/api/videos/" . $videoid, 1) [0], '200') !== FALSE; } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment