Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

ob_iconv_handler

Description

The ob_iconv_handler of iconv for PHP converts character encoding as output buffer handler.

Syntax

ob_iconv_handler(
    string $contents,
    int $status
): string|false

Parameters

contents

Contents of the output buffer.

status

Bitmask of PHP_OUTPUT_HANDLER_* constants.

ConstantValueDescription
PHP_OUTPUT_HANDLER_START1ouput buffer has started
PHP_OUTPUT_HANDLER_FLUSH4ouput buffer is being flushed
PHP_OUTPUT_HANDLER_FINAL8ouput buffer will be ended

Return

Returns a string on success or false on failure.

Examples

1 · callback

<?

$callback = "ob_iconv_handler";

ob_start($callback);

echo "output·";

?>
output·

2 · iconv_set_encoding

<?

$type = "output_encoding";
$encoding = "ISO-8859-1";

iconv_set_encoding($type, $encoding);

$callback = "ob_iconv_handler";

ob_start($callback);

echo "output·";

?>
output�
HomeMenu