I am doing an image upload handler and I would like it to detect the dimensions of the image that\'s been uploaded by the user.
So I start with:
if (isse
You can do this as such
$filename = $_FILES['image']['tmp_name'];
$size = getimagesize($filename);
// or
list($width, $height) = getimagesize($filename);
// USAGE: echo $width; echo $height;
Using the condition combined, here is an example
if (isset($_FILES['image'])) {
$filename = $_FILES['image']['tmp_name'];
list($width, $height) = getimagesize($filename);
echo $width;
echo $height;
}