½ñÌìÔĶÁqeephpµÄÔ´´úÂë·¢ÏÖÁËphpÉñÆæµÄÓ÷¨£¬Ð¡À×ÁËÎÒ¡°Á½Ï¡±¡£Ð´¸öËæ±Ê£¬·ÖÏíÏ¡£
ÇëÔĶÁÈçÏ´úÂ룺
static function create($length = 4, $lefttime = 900, $style = 'simple', array $options = null) { $class_name = 'Helper_ImgCode' . ucfirst(strtolower(preg_replace('/[^a-z0-9_]+/i', '', $style))); $options = (array)$options; $options['code_length'] = $length; $imgcode_obj = new $class_name($options); $code = $imgcode_obj->generateCode(); self::_writeImgcodeToSession($code, $lefttime); return $imgcode_obj->generateImage($code); }
·¢ÏÖÁËÂ𣿱»µ÷ÓõÄÀàÃûÊǶ¯Ì¬¹¹ÔìµÄ£¡£¡£¡
ÏȽ«$style×Ö·û´®È¥µô·Ç·¨×Ö·û£ºpreg_replace('/[^a-z0-9_]+/i', '', $style)
È»ºóÈ«²¿×ª»¯ÎªÐ¡Ð´:strtolower(preg_replace('/[^a-z0-9_]+/i', '', $style))
ÔÙ°ÑÊ××Öĸ´óд£ºucfirst(strtolower(preg_replace('/[^a-z0-9_]+/i', '', $style)))
Á¬½ÓÖ®ºó±ä³ÉÁËÒ»¸öÐèÒªµÄÀàÃû£º$class_name = 'Helper_ImgCode' . ucfirst(strtolower(preg_replace('/[^a-z0-9_]+/i', '', $style)));
×îºóͨ¹ýÀàÃû±äÁ¿µ÷ÓÃÀà´úÂ룬´´½¨ÁËÒ»¸ö¶ÔÏó£º$imgcode_obj = new $class_name($options);
¶Ì¶ÌµÄÁ½ÐдúÂ룬ʡȥÁËswitchÓï¾ä·±ÔÓ¡£
ºÃ´¦²»Ö»ÊÇÔÚÓÚ¼ò½à£¬ÒÔºóÏëÒªÓв»Í¬µÄstyleÀ´´¦ÀíµÄ»°Ö»ÐèÒª¸Ä±ä$styleÖµ£¬È»ºóÔÙдһ¸ö¶ÔÓ¦µÄÀà¾Í¿ÉÒÔÁË¡£´ïµ½Á˺ܺõÄÀ©Õ¹ÐÔ¡£
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ