温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

使用php设计简单验证码

发布时间:2020-06-11 17:26:07 来源:网络 阅读:312 作者:凡瑟尔 栏目:web开发

2017,1,3,星期二

  一、所需的代码,步骤:

    1.新建画布[新建图像]

    resource p_w_picpathcreatetruecolor ( int $width , int $height );

    2.选取颜色

    int p_w_picpathcolorallocatealpha ( resource $p_w_picpath , int $red , int $green , int $blue , int $alpha );

    3.画图

    bool p_w_picpathellipse ( resource $p_w_picpath , int $cx , int $cy , int $width , int $height , int $color )

    4.区域填充

    bool p_w_picpathfill( resource $p_w_picpath   , int $x   , int $y   , int $color );

    5.生成随机数

    int mt_rand( int $min, int $max );

    6.随机打乱一个字符串

    string str_shuffle( string $str );

    7.用 TrueType 字体向图像写入文本

    array p_w_picpathttftext ( resource $p_w_picpath , float $size , float $angle  , int $x  , int $y , int $color , string $fontfile  , string $text  );

    8.返回字符串的子串

    string substr ( string $string, int $start[, int $length  ] )

    9.发送原生 HTTP 头

    void header ( string $string [, bool $replace = true [, int $http_response_code ]] );

    10.以 PNG 格式将图像输出到浏览器或文件

    bool p_w_picpathpng ( resource $p_w_picpath [, string $filename ] );

    11.销毁一图像

    bool p_w_picpathdestroy  ( resource $p_w_picpath );

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI