What function in PHP can be used to get the size of an image?

To get the size of an image in PHP, you can use the `getimagesize()` function. This function returns an array containing the image width, height, type, and attributes. You can then access the width and height values from the returned array to get the size of the image.

$imagePath = 'path/to/image.jpg';
$imageSize = getimagesize($imagePath);
$imageWidth = $imageSize[0];
$imageHeight = $imageSize[1];

echo "Image width: " . $imageWidth . "px<br>";
echo "Image height: " . $imageHeight . "px";