PHP provides a function getimagesize(). This function helps to find the image height,widht, type and attribute.
Here is the sample code:
<?php
if(isset($_POST['submit'])){ // code executes on submit event
list($width, $height, $typeOfFile, $attribute) = getimagesize('$_FILES['imagename']['tmp_name']');
//<input type='file' name='imagename'
echo $width; //output:300
echo $height; //output:400
echo $typeOfFile; //Output:2
echo $attribute; //output: <strong>width="300" height="400"</strong>
}
?>
NOTE:
Type of the image | ||||||||||||||||||
|