首页 > Web开发 > 详细

php Thinkphp 字符转utf8

时间:2019-10-21 20:51:41      阅读:124      评论:0      收藏:0      [点我收藏+]
/**
 * # +========================================================================
 * # | - @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;
}

 

php Thinkphp 字符转utf8

原文:https://www.cnblogs.com/leaf-cq/p/11715545.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!