What is the function in PHP used to measure the height and width of an image?
To measure the height and width of an image in PHP, you can use the getimagesize() function. This function returns an array containing the dimensions of the image as well as other information like image type and MIME type. By using getimagesize(), you can easily retrieve the height and width of an image and use this information in your PHP code.
// Path to the image file
$imagePath = 'path/to/your/image.jpg';
// Get the image size
$imageSize = getimagesize($imagePath);
// Output the width and height of the image
echo 'Image width: ' . $imageSize[0] . ' pixels<br>';
echo 'Image height: ' . $imageSize[1] . ' pixels';