2014年8月8日 星期五

【PHP】 取得圖片資訊 getimagesize

取得圖片資訊:
$size = getimagesize("圖片網址");
print_r($size);
// 結果
Array ( [0] => 414 [1] => 262 [2] => 2 [3] => width="414" height="262" [bits] => 8 [channels] => 3 [mime] => image/jpeg )
說明:
0:寬度 1:長度 2:檔案類型 3:寬度及高度
2:檔案類型有:
1 = GIF,2 = JPG,3 = PNG,4 = SWF,5 = PSD,6 = BMP,7 = TIFF(intel byte order),8 = TIFF(motorola byte order),9 = JPC,10 = JP2,11 = JPX,12 = JB2,13 = SWC,14 = IFF,15 = WBMP,16 = XBM

沒有留言:

張貼留言