<?php
/**
* CodeIgniter 验证码的使用
* 这里面 img_path,img_url 是必填的,其它的选填
*/
$vals = array(
// 'word' => 'Random word', // 传入自定义的随机码
'img_path' => './upload/',
'img_url' => 'http://ci.test/t1/upload/',
'font_path' => './f/Starstruck.ttf',
'img_width' => '150',
'img_height' => 30,
'expiration' => 7200
);
$cap = create_captcha($vals);
//echo $cap['word']; // 这个是生成的验证码
echo $cap['image'];
?>