note 100318 deleted from function.preg-match by danbrown

From: Date: Thu, 07 Oct 2010 19:25:45 +0000
Subject: note 100318 deleted from function.preg-match by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-173063@lists.php.net to get a copy of this message
Note Submitter: gfabricio at gmail dot com ---- //Function to validate youtube urls: function youtubeValidator($url) { if(preg_match('/youtube.com\\/watch\\?.*v=.*$/',$url)) { preg_match('/(?<=\\?v=)[^&]*/',$url,$matches,PREG_OFFSET_CAPTURE); //$chk = curl_init("http://youtube.com/v/{$matches[0][0]}"); //curl_exec($chk); //$i = curl_getinfo($chk); $youtube = "http://youtube.com/v/{$matches[0][0]}"; return $youtube; } return false; }

« previous php.notes (#173063) next »