$location = 'your url';
if(preg_match('/http:\/\/www\.youtube\.com\/watch\?v=[^&]+/', $location, $vresult)) {
$type= 'youtube';
} elseif(preg_match('/http:\/\/(.*?)blip\.tv\/file\/[0-9]+/', $location, $vresult)) {
$type= 'bliptv';
} elseif(preg_match('/http:\/\/(.*?)break\.com\/(.*?)\/(.*?)\.html/', $location, $vresult)) {
$type= 'break';
} elseif(preg_match('/http:\/\/www\.metacafe\.com\/watch\/(.*?)\/(.*?)\//', $location, $vresult)) {
$type= 'metacafe';
} elseif(preg_match('/http:\/\/video\.google\.com\/videoplay\?docid=[^&]+/', $location, $vresult)) {
$type= 'google';
} elseif(preg_match('/http:\/\/www\.dailymotion\.com\/video\/+/', $location, $vresult)) {
$type= 'dailymotion';
}
le résultat est tout simplement vrai/faux ou avez-vous besoin de savoir qui il correspondait –
juste s'il est vrai ou faux – Ryan