|
PHP复制代码 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');class MY_Form_validation extends CI_Form_validation {
public function __construct ()
{
parent ::__construct ();
}
/**
* Alpha-numeric with underscores and dashes
*
* @access public
* @param string
* @return bool
*/
public function alpha_dash_cn ($str)
{
return ( ! preg_match("/^[\\x{4e00}-\\x{9fa5}A-Za-z0-9_]+$/u",$str)) ? FALSE : TRUE;
}
}
复制代码
输入中文,匹配不到,.难道与编码有关
|
|