PHP学习之验证码(1)简易验证码

验证码(1)

  1. str_shuffle() 函数随机打乱字符串中的所有字符。
  2. array_merge — 合并一个或多个数组
  3. join — 别名 implode()
  4. imagechar — 水平地画一个字符,imagechar( resource $image, int $font, int $x, int $y, string $c, int $color)
  5. imagecharup — 垂直地画一个字符imagecharup( resource $image, int $font, int $x, int $y, string $c, int $color)
  6. imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text)
    imagettftext — 用 TrueType 字体向图像写入文本,TrueType是由美国苹果公司和微软公司共同开发的一种电脑轮廓字体(曲线描边字)类型标准。这种类型字体文件的扩展名是.ttf,类型代码是tfil。
  7. //添加像素当做干扰元素
    imagesetpixel($image, $x, $y, $color)画一个单一像素。
  8. //绘制线段当做干扰元素
    imageline($image, $x1, $y1, $x2, $y2, $color)
  9. //绘制圆弧
    imagearc( resource $image, int $cx, int $cy, int $w, int $h, int $s, int $e, int $color)
    imagearc() 以 cx,cy(图像左上角为 0, 0)为中心在 image 所代表的图像中画一个椭圆弧。w 和 h 分别指定了椭圆的宽度和高度,起始和结束点以 s 和 e 参数以角度指定。0°位于三点钟位置,以顺时针方向绘画。
  10. 以下为一个简单验证码实例
posted @ 2019-05-17 19:23  *小龙人*  阅读(160)  评论(0编辑  收藏  举报