合并图片:
<?php
//getimagesize 取得图像大小 array getimagesize( string $filename[, array &$imageinfo] )
// $arr = getimagesize('1.jpg');
//打印图片信息
// list($width,$height) = $arr;
// echo $width,$height;
//打开图片
//imagecreatefromjpeg — 由文件或 URL 创建一个新图象 imagecreatefromjpeg( string $filename)
$dst = imagecreatefromjpeg('1.jpg');
$src = imagecreatefromjpeg('2.jpg');
//合并图片
//imagecopyresampled — 重采样拷贝部分图像并调整大小 imagecopyresampled( resource $dst_image, resource $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h)
imagecopyresampled($dst,$src,10,10,300,100,100,100,100,100);
//告诉浏览器mime类型
header("Content-type:image/jpeg");
//输出到浏览器 imagejpeg — 输出图象到浏览器或文件。 bool imagejpeg( resource $image[, string $filename[, int $quality]] )
imagejpeg($dst);
//销毁资源
imagedestroy($dst);
imagedestroy($src);