php Thinkphp 字符转utf8
/** * # +======================================================================== * # | - @name 转码utf8 * # | - @author cq <just_leaf@foxmail.com> * # | - @copyright zmtek 2018-11-07 * # +------------------------------------------------------------------------ * # | - 1首页 * # +======================================================================== */ function characet($data){ if( !empty($data) ){ $fileType = mb_detect_encoding($data , array('UTF-8','GBK','LATIN1','BIG5')) ; if( $fileType != 'UTF-8'){ $data = mb_convert_encoding($data ,'utf-8' , $fileType); } } return $data; }
还不会,有大招,关注下方公众号直接提问就可以了哈