iconv_get_encoding
Description
The iconv_get_encoding of iconv for PHP retrieves the internal configuration variables of the iconv extension.
Syntax
iconv_get_encoding( string $type = "all" ): array|string|false
Parameters
type
The value of the optional type can be:
Type |
---|
all |
input_encoding |
output_encoding |
internal_encoding |
Return
Returns the current value of the internal configuration variable if successful or false on failure.
If type is omitted or set to "all", iconv_get_encoding() returns an array that stores all these variables.
Examples
1 · void
<? $return = iconv_get_encoding(); print_r($return); ?>
Array ( [input_encoding] => UTF-8 [output_encoding] => UTF-8 [internal_encoding] => UTF-8 )
2 · type · all
<? $type = "all"; $return = iconv_get_encoding($type); print_r($return); ?>
Array ( [input_encoding] => UTF-8 [output_encoding] => UTF-8 [internal_encoding] => UTF-8 )
3 · type · input_encoding
<? $type = "input_encoding"; $return = iconv_get_encoding($type); print_r($return); ?>
UTF-8
4 · type · output_encoding
<? $type = "output_encoding"; $return = iconv_get_encoding($type); print_r($return); ?>
UTF-8
5 · type · internal_encoding
<? $type = "internal_encoding"; $return = iconv_get_encoding($type); print_r($return); ?>
UTF-8