What changes were made in PHP 8.0 regarding the imagesx function?

In PHP 8.0, the imagesx function no longer accepts a GD image resource as its parameter. To fix this issue, you need to pass the image resource through the getimagesize function to retrieve the width of the image.

// Get the width of an image using getimagesize function
$image_info = getimagesize('image.jpg');
$width = $image_info[0];
echo $width;