0

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

1
  • Why does your size attribute contain a string? AFAIK it is an old integer attribute to refer to how large you want the input. Some browsers ignore it. Commented Nov 13, 2010 at 6:09

2 Answers 2

3

Use imagesx(), imagesy(), or getimagesize()

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.