Header"CONTENT-TYPE:TEXT/HTML;CHARSET=GBK");$mime=Array(' gif '=' Image/gif ',' jpg '=' Image/jpeg ',' JPEG '=' Image/jpeg ',' JPE '=' Image/jpeg ',' BMP '=' Image/bmp ',' PNG '=' Image/png ',' tif '=' Image/tiff ',' TIFF '=' Image/tiff ',' PICT '=' Image/x-pict ',' pic '=' Image/x-pict ',' pct '=' Image/x-pict ',' tif '=' Image/tiff ',' TIFF '=' Image/tiff ',' PSD '=' Image/x-photoshop ',' SWF '=' Application/x-shockwave-flash ',' JS '=' application/x-javascrīpt ',' PDF '=' Application/pdf ',' ps '=' application/postscrīpt ',' EPS '=' application/postscrīpt ',' AI '=' application/postscrīpt ',' WMF '=' Application/x-msmetafile ',' CSS '=' Text/css ',' htm '=' text/html ',' HTML '=' text/html ',' txt '=' Text/plain ',' xml '=' Text/xml ',' WML '=' TEXT/WML ',' Wbmp '=' Image/vnd.wap.wbmp ',' mid '=' Audio/midi ',' wav '=' Audio/wav ',' mp3 '=' Audio/mpeg ',' MP2 '=' Audio/mpeg ',' avi '=' Video/x-msvideo ',' MPEG '=' Video/mpeg ',' mpg '=' Video/mpeg ',' QT '=' Video/quicktime ',' mov '=' Video/quicktime ',' Lha '=' Application/x-lha ',' Lzh '=' Application/x-lha ',' Z '=' application/x-compress ',' Gtar '=' Application/x-gtar ',' GZ '=' Application/x-gzip ',' gzip '=' Application/x-gzip ',' tgz '=' Application/x-gzip ',' tar '=' Application/x-tar ',' bz2 '=' Application/bzip2 ',' Zip '=' Application/zip ',' Arj '=' Application/x-arj ',' rar '=' application/x-rar-compressed ',' hqx '=' application/mac-binhex40 ',' Sit '=' Application/x-stuffit ',' bin '=' Application/x-macbinary ',' UU '=' Text/x-uuencode ',' Uue '=' Text/x-uuencode ',' Latex '=' Application/x-latex ',' LTX '=' Application/x-latex ',' Tcl '=' APPLICATION/X-TCL ',' PGP '=' APPLICATION/PGP ',' ASC '=' APPLICATION/PGP ',' exe '=' Application/x-msdownload ',' Doc '=' Application/msword ',' RTF '=' Application/rtf ',' xls '=' Application/vnd.ms-excel ',' ppt '=' Application/vnd.ms-powerpoint ',' MDB '=' application/x-msaccess ',' WRI '=' Application/x-mswrite ',);$url=' http://tp4.sinaimg.cn/1692980395/180/1298526784/0 ';//$url = ' http://www.baidu.com/';$ch= Curl_init (); curl_setopt ($ch, Curlopt_url,$url); Curl_setopt ($ch, Curlopt_useragent,$_server[' Http_user_agent ']); Curl_setopt ($ch, Curlopt_header,1); Curl_setopt ($ch, Curlopt_nobody,1); Curl_setopt ($ch, Curlopt_returntransfer,1);$contents= Curl_exec ($ch); Curl_close ($ch);if(Preg_match ('/content-type:\s+ (. *?) (?:; |\s)/I ',$contents,$arr)){$mimestr= Strtolower (Trim ($arr[1]));$outkey= Array_keys ($mime,$mimestr);Echo' file type is: '. Implode (',',$outkey) ;}Else{Echo' no match to type ';}
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the file mime-type, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.