thinkphp访问mysql中文字段问题

别人的数据库做接口,用到了中文字段,会报错,需要修改db/builder/mysql.php

w只匹配数字字母下划线,匹配不到汉字。

所以我们要在正则表达式上加上汉字匹配

if ($strict && !preg_match('/^[w.*x00-xff]+$/', $key)) {

        throw new Exception('not support data:' . $key);

}

原文地址:https://www.cnblogs.com/GarfieldTom/p/14119110.html