我在 php 中使用 IMAGETTFTEXT 函数在某些图像上编写文本。现在我想在我的图像上编写 html 标签,例如 IMG 标签。我不知道该怎么做!我需要帮助。这是我的代码:
$font_file = 'times.ttf';
$font_size=15;
$image_file= 'new.jpg';
$image = imagecreatefromjpeg($image_file);
$font_color = imagecolorallocate($image, 0, 0, 0);
imagettftext($image, $font_size, 0, 55, 30, $font_color, $font_file, "fhfghfghfghfg ");
imagettftext($image, $font_size, 0, 600, 30, $font_color, $font_file, "aaaaaaa ");
Header("Content-type: image/jpg");
imagejpeg($image);
imagedestroy($image);