Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function vidCheck($vid) {
- $url = 'https://img.youtube.com/vi/'.$vid.'/0.jpg?fresh='.time();
- $headers = get_headers($url);
- return (substr($headers[0], 9, 3) == 200) ? true : false;
- }
- // usage; video id from url: https://www.youtube.com/watch?v=z3PpphdrEmU
- // echo vidCheck('z3PpphdrEmU');
Advertisement
Add Comment
Please, Sign In to add comment