最新的进展:修改getfiletype为
function GetFiletype($filename){ //add by jiuhecai begin if(strstr($filename,"://")){ $pathinfo = pathinfo($filename); if(array_key_exists("extension",$pathinfo)){ return strtolower(".".RepGetFiletype($pathinfo["extension"])); } $mimes=array( 'image/bmp'=>'bmp', 'image/gif'=>'gif', 'image/jpeg'=>'jpg', 'image/png'=>'png', 'image/x-icon'=>'ico', 'image/webp'=>'webp' ); if(($headers=get_headers($filename, 1))!==false){ $type=$headers['Content-Type']; if(isset($mimes[$type])){ return strtolower(".".RepGetFiletype($mimes[$type])); } } } //add by jiuhecai end
$filer=explode(".",$filename); $count=count($filer)-1; return strtolower(".".RepGetFiletype($filer[$count])); }
|