Created
June 23, 2015 20:55
-
-
Save petk/813270d801bad54d3cc4 to your computer and use it in GitHub Desktop.
Check if youtube video exists
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 | |
$headers = get_headers('http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=nonexistingid'); | |
if (!strpos($headers[0], '200')) { | |
echo "The YouTube video you entered does not exist"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I dont use php but that link helped me ┗|`O′|┛