开发者

how to get the image size using php

开发者 https://www.devze.com 2023-01-24 17:06 出处:网络
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 .

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消