What is the difference between imagecopyresized() and imagecopyresampled() in PHP?

The main difference between imagecopyresized() and imagecopyresampled() in PHP is the quality of the resized image. imagecopyresized() simply resizes the image without smoothing or interpolation, which can result in a lower quality image. On the other hand, imagecopyresampled() uses interpolation to create a smoother, higher quality resized image.

// Example using imagecopyresampled() to resize an image
$source = imagecreatefromjpeg('source.jpg');
$destination = imagecreatetruecolor(200, 200);
imagecopyresampled($destination, $source, 0, 0, 0, 0, 200, 200, imagesx($source), imagesy($source));
imagejpeg($destination, 'resized_image.jpg');
imagedestroy($source);
imagedestroy($destination);