时间:2021-07-01 10:21:17 帮助过:2人阅读
// 以下是https://www.gxlcms.com/createImage.php include(Text_CAPTCHA文件); //如果include路径已指向pear目录,可以没有这句话 $captcha = Text_CAPTCHA::factory('Image'); //生成对象先 //以下依次是大小,字库文件的路径,字库文件名 $opts = array('font_size' => 20, 'font_path' => Zend_Registry::get('config')->paths->data, 'font_file' => 'VeraBd.ttf'); $phare = 自定义一个随机数; $captcha->init(120, 60, $phrase, $opts); //120和60是生成图片的宽和高 //这里我选择png图片,随意,也可用jpg header('Content-type: image/png'); echo $captcha->getCAPTCHAAsPng();
//以下是test.html