(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
mb_internal_encoding — 設置/獲取內部字符編碼
encoding
encoding
字符編碼名稱(chēng)使用于 HTTP 輸入字符編碼轉換、HTTP 輸出字符編碼轉換、mbstring 模塊系列函數字符編碼轉換的默認編碼。
You should notice that the internal encoding is totally different from the one for multibyte regex.
如果設置了 encoding
,則成功時(shí)返回 true
, 或者在失敗時(shí)返回 false
。
In this case, the character encoding for multibyte regex is NOT changed.
如果省略了 encoding
,則返回當前的字符編碼名稱(chēng)。
示例 #1 mb_internal_encoding() 例子
<?php
/* 設置內部字符編碼為 UTF-8 */
mb_internal_encoding("UTF-8");
/* 顯示當前的內部字符編碼*/
echo mb_internal_encoding();
?>