您当前的位置:首页 > php > php用gd库生成验证码图片
php用gd库生成验证码图片
日期:2021-08-24 17:35:05 浏览:270
<?php
header("content-Type: image/png");
$img = imagecreatetruecolor(100, 100);
// $img= imagecreate(100,100);
$red = imagecolorallocate($img, 255, 0, 0);
$white = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0,$red);
imagechar($img,5,10,10,"a",$white);
// imageline() //画线
imagestring($img,10,20,20,'ab',$white);
// imagettftext($img,15,30,10,10,$white,'Arial',"哈哈");
imagepng($img);
imagedestroy($img);
上一篇: php文件上传
下一篇: php替换换行回车符textarea