imagecopyresampled()
Here's a contrived example. It produces an image the same size as the original, with a fractional part ($cut_off) removed from each side. In other words, it magnifies the center part of the picture.
$img_file = 'my image.jpg';
$cut_off = 1/4;
list($img_x, $img_y) = getimagesize($img_file);
$crop_x = round($img_x * $cut_off);
$crop_y = round($img_y * $cut_off);
$img_dest_x = $img_x - $crop_x;
$img_dest_y = $img_y - $crop_y;
$img_dest = imagecreatetruecolor($img_x, $img_y);
$img_src = imagecreatefromjpeg($img_file);
imagecopyresampled($img_dest, $img_src, 0, 0, $crop_x, $crop_y, $img_x, $img_y, $img_x - 2 * $crop_x, $img_y - 2 * $crop_y);
imagejpeg($img_dest);