If you have an image and want to create a new image, with new dimensions, you can use imagecopyresampled function:
first create a new image with desired dimensions:
// new image
$dst_img = imagecreatetruecolor($width, $height);
and store the original image into a variable. To do so, you may us...