Home >Backend Development >PHP Tutorial >Codeigniter shopping cart class cannot add Chinese solution, codeigniter cart class_PHP tutorial

Codeigniter shopping cart class cannot add Chinese solution, codeigniter cart class_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:12:44892browse

Codeigniter shopping cart class cannot add Chinese solution, codeigniter cart class

The example in this article describes the solution to the problem that the Codeigniter shopping cart class cannot add Chinese. Share it with everyone for your reference. The specific analysis is as follows:

Some friends may find that the Codeigniter shopping cart class cannot add Chinese. I searched for a long time and found that the following code restricts the input of Chinese. I modified systemlibrariesCart.php and commented out the product name judgment on lines 186-190. The code is as follows :

Copy code The code is as follows:
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;
}

But deleting is not the best way. We can just change the regular matching to Chinese. Interested friends can refer to this article "Problems with PHP Regular Expression Verification in Chinese".

I hope this article will be helpful to everyone’s ThinkPHP framework programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/919621.htmlTechArticleCodeigniter shopping cart class cannot be added to the Chinese solution, codeigniter cart class The example of this article tells that the Codeigniter shopping cart class cannot be added Chinese solution. Share it with everyone for your reference...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn