// Use getImageInfo() to get the dimensions of an image $info = getImageInfo('/path/to/image.jpg'); $width = $info['width']; $height = $info['height']; // Output the dimensions echo "Image dimensions: $width x $height";
// Use getImageInfo() to get the MIME type of an image $info = getImageInfo('/path/to/image.jpg'); $mime = $info['mime']; // Check if the MIME type is a supported image format if (strpos($mime, 'image/') === 0) { echo "This is an image file."; } else { echo "This is not an image file."; }The package library for getImageInfo() is the PHP GD library, which is a popular library for working with images in PHP. This library provides a wide range of image processing functions, including functions for creating, manipulating, and displaying images.