在这个图片上生成成绩啥的。

解决方案 »

  1.   

    <?php
    header("Content-Type: text/html;charset=utf-8");
    //指定图片路径
    $src = '001.png';
    //获取图片信息
    $info = getimagesize($src);
    //获取图片扩展名
    $type = image_type_to_extension($info[2],false);
    //动态的把图片导入内存中
    $fun =  "imagecreatefrom{$type}";
    $image = $fun('001.png');
    //指定字体颜色
    $col = imagecolorallocatealpha($image,0,0,0,0); //R,G,B,透明度
    //指定字体内容
    $content = 'zhangsan';
    //给图片添加文字
    imagestring($image,5,190,255,$content,$col);//指定字体内容
    $content = '123456789';
    //给图片添加文字
    imagestring($image,5,190,285,$content,$col);//指定字体内容
    $content = '98.6';
    //给图片添加文字
    imagestring($image,5,190,320,$content,$col);//指定输入类型
    header('Content-type:'.$info['mime']);
    //动态的输出图片到浏览器中
    $func = "image{$type}";
    $func($image);
    //销毁图片
    imagedestroy($image);?>
      

  2.   


    中文水印可以参考:https://blog.csdn.net/qq_17497931/article/details/86721110
      

  3.   

    汉字显示乱码是什么原因?我看了 没有bom头啥的