Copy CodeThe code is as follows:
function Video_image ($url) {
$image _url = Parse_url ($url);
if ($image _url[' host '] = = ' www.youtube.com ' | |
$image _url[' host '] = = ' youtube.com ') {
$array = Explode ("&", $image _url[' query ');
Return "http://img.youtube.com/vi/". substr ($array [0], 2). " /0.jpg ";
}else if ($image _url[' host '] = = ' www.youtu.be ' | |
$image _url[' host '] = = ' youtu.be ') {
$array = Explode ("/", $image _url[' path ');
Return "http://img.youtube.com/vi/". $array [1]. " /0.jpg ";
}else if ($image _url[' host '] = = ' Www.vimeo.com ' | |
$image _url[' host '] = = ' vimeo.com ') {
$hash = Unserialize (file_get_contents ("http://vimeo.com/api/v2/video/").
substr ($image _url[' path '], 1). ". PHP "));
return $hash [0]["Thumbnail_medium"];
}
}
"/>
http://www.bkjia.com/PHPjc/735247.html www.bkjia.com true http://www.bkjia.com/PHPjc/735247.html techarticle Copy the code as follows: function Video_image ($url) {$image _url = Parse_url ($url), if ($image _url[' host '] = = ' www.youtube.com ' | | $i mage_url[' host '] = = ' youtube.com ') {$array = ex ...