图片验证码
命令行安装组件
composer require gregwar/captcha
使用
<?php
include "./vendor/autoload.php";
use Gregwar\Captcha\CaptchaBuilder as CaptchaBuilder;
$builder = new CaptchaBuilder();
$builder->build();
setcookie('phrase', $builder->getPhrase());
header('Content-type: image/jpeg');
$builder->output();