- get_headers: documentation ( source)
- strpos: documentation ( source)
<?php
$headers = @get_headers('http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=vPlT2uKruwM');
if (!strpos($headers[0], '200')) {
echo "The YouTube video you entered does not exist";
return false;
}