最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 检测字符编码mb_detect_encoding()函数
时间:2022-11-14 23:01:07 编辑:袖梨 来源:一聚教程网
文章提供这款mb_detect_encoding函数是一款可以检测你使用的字符串是什么编码,然后返回字符串编码字符,下面是一个简单应用实例。
*/
function asciitog($brand)
{
$cha=mb_detect_encoding($brand);
if($cha=='utf-8')
{
$brand2 = iconv($cha,"gb2312",$brand);
}
$cha2=mb_detect_encoding($brand2);
if($cha2!='ascii'){
$brand=$brand2;
}
return $brand;
}
/*
mb_detect_encoding
语法
string mb_detect_encoding ( string $str [, mixed $encoding_list = mb_detect_order() [, bool $strict = false ]] )
说明
mb_detect_encoding 用来检测字符串所使用编码,并返回相对应编码字符串!
本站原创教程转载注明来源于http://www.111com.net/phper/php.html
*/
相关文章
- 银与绯吉尔兰技能怎么样 吉尔兰战斗特性解析 07-14
- 异环异象管理局局长是谁 艾尔菲德角色详细介绍 07-14
- 欧意易ok官网下载版 欧意易app下载 07-14
- 迷你世界马车怎么做 马车制作方法介绍 07-14
- 碳碳岛许愿池有什么作用 许愿池建造方法介绍 07-14
- 最终幻想14水晶世界怎么招募雇员 招募雇员方法介绍 07-14