CakeFest 2024: The Official CakePHP Conference

mb_http_output

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

mb_http_outputHTTP 出力文字エンコーディングを設定あるいは取得する

説明

mb_http_output(?string $encoding = null): string|bool

HTTP 出力文字エンコーディングを設定あるいは取得します。 この関数を実行した後、 出力は内部エンコーディングから encoding に変換されます。

パラメータ

encoding

encoding が設定された場合、 mb_http_output() は HTTP 出力文字エンコーディングを encodingに設定します。

encoding が省略された場合、 mb_http_output() は現在の HTTP 出力文字エンコーディングを返します。

戻り値

encoding が省略された場合、 mb_http_output() は現在の HTTP 出力文字エンコーディングを返します。それ以外の場合、 成功した場合に true を、失敗した場合に false を返します。

変更履歴

バージョン 説明
8.0.0 encoding は、nullable になりました。

参考

add a note

User Contributed Notes 1 note

up
3
anders jenbo pc dk
16 years ago
By default this is set to 'pass' witch means that php will not touch the encoding and output it as it is in the source file.

Normaly this function isn't needed as long as you save the .php file in the same encoding as you want it to output as well as retrive all input in the same encoding, but it don't seam to herd as long as it able to figure out what encoding the output is in ín the first place.
To Top