php制作验证码用到的函数

 

join()函数:把数组元素组合为一个字符串。

<?php
$number = range(0,5);
print_r ($number);
?>

     举例:

结果:Hello World! I love Shanghai!

range():range() 函数创建一个包含指定范围的元素的数组。举例:

<?php
$arr = array('Hello','World!','I','love','Shanghai!');
echo join(" ",$arr);
?>

        结果:Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 )

substr():substr() 函数返回字符串的一部分。举例:

<?php
echo substr("Hello world",6);
?>

结果:world

str_shuffle()  :函数随机地打乱字符串中的所有字符。

语法 :str_shuffle(string)

 

strtoupper() 函数把字符串转换为大写。语法 :strtoupper(string)

 

imagecreatetruecolor() 功能与 imagecreate() 类似,创建一幅真彩色的图像,从而支持更为丰富的色彩。imagecreatetruecolor( int x, int y ) 

imagefill() 函数用于图像区域填充。语法 : bool imagefill( resource image, int x, int y, int color )

imagecolorallocate — 为一幅图像分配颜色。语法 : int imagecolorallocate ( resource $image , int $red , int $green , int $blue )

mt_rand() 使用 Mersenne Twister 算法返回随机整数。语法 :mt_rand(min,max)

ceil() 函数向上舍入为最接近的整数。语法 :ceil(x)

imagechar() — 写出横向的字符。语法 :bool imagechar ( resource $image , int $font , int $x , int $y , string $c , int $color )

bool imagesetpixel(resource $image,int $x,int $y,int $color)                         //画一个单一像素

bool imageline(resource $image,int $x1,int $y1,int $x2,int $y2,int $color)                //画一条线段

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值