使用以下功能向文本添加边框
原文链接:https://www.f2er.com/php/133548.html你可以在这里检查示例输出http://wmh.github.io/hunbook/examples/gd-imagettftext.html
function imagettfstroketext(&$image,$size,$angle,$x,$y,&$textcolor,&$strokecolor,$fontfile,$text,$px) { for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++) for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++) $bg = imagettftext($image,$c1,$c2,$strokecolor,$text); return imagettftext($image,$textcolor,$text); }