/** * 显示验证码图片 * @param $width 宽 * @param $height 高 * @param $length 字符串长度 * @param $format 图片格式(默认png) * <p>可选项: * <br>PNG * <br>JPG * <br>GIF */ public static final function show($width = null, $height = null, $length = 4, $format = PNG) { $width = intval($width); $height = intval($height); if ($width > 0) { self::$width = $width; } if ($height > 0) { self::$height = $height; } self::create(); self::create_disturb_points(); self::create_disturb_lines(); self::create_code($length); self::create_picture(self::$code); $method = 'get_' . $format; self::$method(); imagedestroy(self::$im); }