$im = imagecreatefrompng('example.png');
$arr = [
['x' => 0, 'y' => 0, 'width' => 960, 'height' => 540],
['x' => 960, 'y' => 0, 'width' => 960, 'height' => 540],
['x' => 0, 'y' => 540, 'width' => 960, 'height' => 540],
['x' => 960, 'y' => 540, 'width' => 960, 'height' => 540],
];
foreach($arr as $k=>$v){
$im2 = imagecrop($im, $v);
if ($im2 !== FALSE) {
imagepng($im2, "example-cropped$k.png");
imagedestroy($im2);
}
}
imagedestroy($im);