Codeigniter 购物车类不能添加中文解决方法
有朋友可能会发现Codeigniter 购物车类不能添加中文,我找了N久才发现下面一段代码限制了输入中文了,修改systemlibrariesCart.php,注释第186-190行产品名称的判断,代码如下:
/*if ( ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name'])) { log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces'); return FALSE; } */不过删除不是最好的办法,我们可以直接把正则匹配改成中文也可以就行了.
查看更多关于Codeigniter 购物车类不能添加中文解决方法 - php类的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did29579