= 4.0.6, PHP 5, PHP 7, PHP 8)mb_internal_encoding — 設置/獲取內部字符編碼說明mb_internal_encoding(string $encoding = mb_internal_encod">

mb_internal_encoding

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

mb_internal_encoding設置/獲取內部字符編碼

說明

mb_internal_encoding(string $encoding = mb_internal_encoding()): mixed

設置/獲取內部字符編碼

參數(shù)

encoding

encoding 字符編碼名稱使用于 HTTP 輸入字符編碼轉換、HTTP 輸出字符編碼轉換、mbstring 模塊系列函數(shù)字符編碼轉換的默認編碼。 You should notice that the internal encoding is totally different from the one for multibyte regex.

返回值

如果設置了 encoding,則成功時返回 true, 或者在失敗時返回 false。 In this case, the character encoding for multibyte regex is NOT changed. 如果省略了 encoding,則返回當前的字符編碼名稱。

范例

示例 #1 mb_internal_encoding() 例子

<?php
/* 設置內部字符編碼為 UTF-8 */
mb_internal_encoding("UTF-8");

/* 顯示當前的內部字符編碼*/
echo mb_internal_encoding();
?>

參見