ob_clean();$realname = "姓名:最闲的码农";$schoolname = "社区:laravel"; $image = imagecreatefrompng('1562926506930.png'); //书模版图片文件的路径 必须是png格式的文件$red = imagecolorallocate($image,00,00,00); // 字体颜色// imagettftext("image", "font size", "rotate text", "left position","top position", "font color", "font name", "text to print");//根据文本填写的位置不同//"left position 和 top position 可以使用 getimagesize进行配合计算文字x和y轴坐标imagettftext($image, 50, 0, 628, 615, $red, 'simheittf.ttf',$realname);imagettftext($image, 50, 0, 628, 714, $red, 'simheittf.ttf', $schoolname);header('content-type: image/png;');imagepng($image);imagedestroy($image);$filename = 'certificate_aadarsh.png';imagepng($image, $filename);imagedestroy($image);
wechatimg3.jpeg
相关推荐:《php教程》
以上就是php生成奖状的详细内容。