/** * # +======================================================================== * # | - @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; }