<?php
$bigImgPath = "./img/bg.jpg";
$qCodePath = "./img/s.jpg";
$bigImg = imagecreatefromstring(file_get_contents($bigImgPath));
$qCodeImg = imagecreatefromstring(file_get_contents($qCodePath));
list($qCodeWidth, $qCodeHight, $qCodeType) = getimagesize($qCodePath);
imagecopymerge($bigImg, $qCodeImg, 10, 10, 0, 0, $qCodeWidth, $qCodeHight, 100);
list($bigWidth, $bigHight, $bigType) = getimagesize($bigImgPath);
//var_dump(getimgize($bigImgPath));die;
$id=999;
//imagepng($bigImg,'./img/'.$id.'.png');
imagejpeg($bigImg,'./img/'.$id.'.jpg');