how to get the image size using php
hi guys i am using <input type='file' name='filett' size='filett'>
and 开发者_运维百科move the file into the temporary location. Just i wants to know how to get the image size using php . i am using $rect = thegetimagesize("img/flag.jpg");
but if i echo the variable $rect
it shows the error
Use imagesx()
, imagesy()
, or getimagesize()
You mean the filesize or dimensions?
Dimensions
getimagesize()
will get a bunch of info about an image. Easiest way to get width and height is to assign it to list($width, $height)
language construct.
Filesize
filesize()
will get the size of bytes in the file. Divide by 1024 to get kilobytes and so forth.
精彩评论