Description
string
mb_output_handler ( string contents, int status)
mb_output_handler() is
ob_start() callback
function_ mb_output_handler() converts
characters in output buffer from internal character encoding to
HTTP output character encoding_
4_1_0 or later version, this hanlder adds charset HTTP header
when following conditions are met:
Does not set Content_Type by
header()
Default MIME type begins with
text/
http_output setting is other than
pass
contents : Output buffer contents
status : Output buffer status
Return Value: String converted
Ejemplo 1_ mb_output_handler() example <?php
mb_http_output("UTF_8");
ob_start("mb_output_handler");
?> |
|
Nota:
If you want to output some binary data such as image from PHP
script with PHP 4_3_0 or later, Content_Type: header must be send
using header() before any binary data was send
to client (e_g_ header("Content_Type: image/png"))_
If Content_Type: header was send, output character encoding
conversion will not be performed_
Note that if 'Content_Type: text/*' was send using
header(), the sending data is regarded as text,
encoding conversion will be performed using character encoding
settings_
If you want to output some binary data such as image from PHP
script with PHP 4_2_x or earlier, you must set output encoding to
"pass" using mb_http_output()_
See also ob_start()_