Merge or Join two or more images as single image in php

// get the images sources
$src1 = imagecreatefromjpeg('images/image1.jpg');
$src2 = imagecreatefromjpeg('imges/image2.jpg');

//Create a blank image and set the width and height
$dest = imagecreatetruecolor(300, 900);







//Now copy the source image on the created blank image on the set positions
imagecopy($dest, $src1, 0, 0, 0, 0, 300, 400);
imagecopy($dest, $src2, 0, 350, 0, 0, 300, 400);