The following code outputs the watermark and overlay text, but not the other image, bwshoes.png.
<?php
//First we have to set the output of the page.
//Here we set it as image. Because we are going to show an image directly
header('content-type: image/jpeg');
//Then we set the image and watermark image.
$source_image = 'image.jpg';
//Important thing is we need to create watermark image as png image.
//Else the transparent ares will be white colored in our watermark image area.
//And also we need to use a png image to show transparency.
$my_watermark = imagecreatefrompng('bwshoes.png');
//Then we will get the width and height of the watermark image.
//We will use these dimensions to locate it fit position.
$watermark_width = imagesx($my_watermark);
$watermark_height = imagesy($my_watermark);
//So now we are going to create our image component from the source image.
$image = imagecreatefromjpeg($source_image);
//and we get its dimensions
$image_size = getimagesize($source_image);
//Extra we need to configure the watermark text
//and font type, font size, color and text angle
$watermarktext = "Thecodeprogram";
$font = "ahronbd.ttf";
$fontsize = "25";
$color = imagecolorallocate($image2, 255, 255, 255);
$textangle = 0;
//Then we specify the position of the watermark.
//We will locate it right under corner of the image with 20px margin from edges.
$wm_a = $image_size[0] - $watermark_width - 94;
$wm_b = $image_size[1] - $watermark_height - 94;
$wm_x = $image_size[2] - $watermark_width - 94;
$wm_y = $image_size[3] - $watermark_height - 78;
//And then we write the text on the image.
imagettftext($image, $fontsize, $textangle, $wm_a, $wm_b, $color, $font, $watermarktext);
//Then we are copying the watermark image on created image component with configured locations and dimensions.
imagecopy($image, $my_watermark, $wm_x, $wm_y, $watermark_width, $watermark_height);
//Lastly show the image on the screen. Do not forget to set header as image of the page.
//echo '<div style="border-width:3px; border-style:solid; border-color:white;">'.imagejpeg($image).'</div>';
//Then show it on the page
imagejpeg($image);
imagedestroy($image);
?>