search
Homephp教程php手册php函数mb_detect_encoding自动识别编码并自动转换成utf8的方法

php中有一个自动识别编码的函数mb_detect_encoding(),下面的代码是探测文章编码并自动转换成utf8的方法 //自动识别编码并自动转换成utf8 /* 爱推吧 http://ituibar.com */ function characet($data){ if(!empty($data)){ $fileType=mb_detect_encoding($date

php中有一个自动识别编码的函数mb_detect_encoding(),下面的代码是探测文章编码并自动转换成utf8的方法

//自动识别编码并自动转换成utf8
 /*
 爱推吧 http://ituibar.com
 */
 function characet($data){
 if(!empty($data)){
 $fileType=mb_detect_encoding($date,array('utf-8','GBK','LATIN1','BIG5'));
 if($fileType !='utf-8'){
 $data=mb_convert_encoding($data, 'utf-8',$fileType) ;
 }
 }
 return $date;
 }
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use