是否有一种优雅且简单/简单的方法可以使用 PHP、Javascript 或 Jquery 来做到这一点?
最佳答案
您可以使用 PHP imagestring() 函数来创建图像。
<?php
// Create a 100*30 image
$im = imagecreate(120, 30);
// White background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// Write the email address at the top left
imagestring($im, 5, 0, 0, 'test@test.com', $textcolor);
// Output the image
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>