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

To check the size of an image in PHP, you can use the `getimagesize()` function. This function returns an array containing the dimensions and other information about the image. You can then access the size information from the array to determine the width and height of the image.

$image_path = 'path_to_your_image.jpg';
$image_size = getimagesize($image_path);

$image_width = $image_size[0];
$image_height = $image_size[1];

echo "Image width: " . $image_width . " pixels<br>";
echo "Image height: " . $image_height . " pixels";