- 1). Open your PHP file using a PHP, HTML or text editor.
- 2). Type the following code:
list($img_width, $img_height, $img_type, $attrs)=getimagesize("images/myimage.jpg");
The "$img_width" variable returns the width value in pixels, while "$img_height" returns the height of the image named in the "getimagesize" function. - 3). Save the file and upload it to your server to test the code.
previous post