mb_convert_encoding

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

mb_convert_encoding转锟斤拷锟街凤拷锟侥憋拷锟斤拷

说锟斤拷

mb_convert_encoding ( string $str , string $to_encoding [, mixed $from_encoding = mb_internal_encoding() ] ) : string

锟斤拷 string 锟斤拷锟斤拷 str 锟斤拷锟街凤拷锟斤拷锟斤拷涌锟窖★拷锟� from_encoding 转锟斤拷锟斤拷 to_encoding锟斤拷

锟斤拷锟斤拷

str

要锟斤拷锟斤拷锟� string锟斤拷

to_encoding

str 要转锟斤拷锟缴的憋拷锟斤拷锟斤拷锟酵★拷

from_encoding

锟斤拷转锟斤拷前通锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷指锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷 array 也锟斤拷锟斤拷锟角讹拷锟脚分革拷锟斤拷枚锟斤拷锟叫憋拷 锟斤拷锟矫伙拷锟斤拷峁� from_encoding锟斤拷锟斤拷锟绞癸拷锟斤拷诓锟斤拷锟絠nternal锟斤拷锟斤拷锟诫。

锟轿硷拷支锟街的憋拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟斤拷 string锟斤拷

锟斤拷锟斤拷

Example #1 mb_convert_encoding() 锟斤拷锟斤拷

<?php
/* 转锟斤拷锟节诧拷锟斤拷锟斤拷为 SJIS */
$str mb_convert_encoding($str"SJIS");

/* 锟斤拷 EUC-JP 转锟斤拷锟斤拷 UTF-7 */
$str mb_convert_encoding($str"UTF-7""EUC-JP");

/* 锟斤拷 JIS, eucjp-win, sjis-win 锟斤拷锟皆讹拷锟斤拷锟斤拷锟诫,锟斤拷转锟斤拷 str 锟斤拷 UCS-2LE */
$str mb_convert_encoding($str"UCS-2LE""JIS, eucjp-win, sjis-win");

/* "auto" 锟斤拷展锟斤拷 "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
$str mb_convert_encoding($str"EUC-JP""auto");
?>

锟轿硷拷

  • mb_detect_order() - 锟斤拷锟斤拷/锟斤拷取 锟街凤拷锟斤拷锟斤拷募锟斤拷顺锟斤拷