<?php
$dst_path
= 'http:
$dst
= imagecreatefromstring(
file_get_contents
(
$dst_path
));
$font
= './t1.ttf';
$black
= imagecolorallocate(
$dst
, 0, 0, 0);
imagefttext(
$dst
, 20, 0, 10, 30,
$black
,
$font
, 'Hello world!');
list(
$dst_w
,
$dst_h
,
$dst_type
) =
getimagesize
(
$dst_path
);
switch
(
$dst_type
){
case
1:
header(
"content-type:image/gif"
);
imagegif(
$dst
);
break
;
case
2:
header(
"content-type:image/jpeg"
);
imagejpeg(
$dst
);
break
;
case
3:
header(
"content-type:image/png"
);
imagepng(
$dst
);
break
;
default
:
break
;
}
imagedestroy(
$dst
);
?>