2010年1月11日 星期一

[PHP] 取得圖片寬高尺寸

PHP 函式

getimagesizeGet the size of an image
Note: This function does not require the GD image library.
(Server 必須要安裝 GD 函式庫)


呼叫方式:

array getimagesize ( string $filename [, array &$imageinfo ] )


傳回結果:
Array
(
    [0] => 450
    [1] => 803
    [2] => 2
    [3] => width="450" height="803"
    [bits] => 8
    [channels] => 3
    [mime] => image/jpeg
)

沒有留言: