<?php $this->load->helper('captcha'); $vals = array( 'word' => rand(1000, 10000), 'img_path' => './captcha/', 'img_url' => 'http://localhost/ci/captcha/', //'font_path' => './path/to/fonts/texb.ttf', 'img_width' => '150', 'img_height' => 30, 'expiration' => 7200 ); $cap = create_captcha($vals); echo $cap['image']; ?>
运行结果如下图所示:
希望本文所述对大家的CI框架程序设计有所帮助。