mb_http_output
Set/get HTTP output character encoding
Function name: mb_http_output()
Function description: mb_http_output() function sets the HTTP output character encoding.
Applicable version: PHP 4 >= 4.0.6, PHP 5, PHP 7
Syntax: mb_http_output([string $encoding = mb_http_output()])
parameter:
Return value: If no encoding parameter is provided, the current HTTP output character encoding is returned. If encoding parameter is provided, return true to indicate the setting is successful, or false to indicate the setting is failed.
Example:
$encoding = mb_http_output(); echo "当前的HTTP 输出字符编码为:" . $encoding;
Output:
当前的HTTP 输出字符编码为:UTF-8
$result = mb_http_output('GBK'); if($result) { echo "HTTP 输出字符编码设置成功!"; } else { echo "HTTP 输出字符编码设置失败!"; }
Output:
HTTP 输出字符编码设置成功!
Notes: