Takes a unicode string and converts it to a string in
the specified encoding
.
Parameters
input
The unicode string that is converted.
encoding
The new encoding for input
.
errmode
Conversion error mode. This parameter determines the action to take when
the converter cannot convert a character. For a list of available modes,
refer to unicode_set_error_mode(). If the parameter
is not set, the global error mode is used.
echo 'Unicode semantics: ', ini_get ('unicode_semantics'), PHP_EOL; echo 'The string itself:', $encoded, PHP_EOL; echo 'The length of the string: ', strlen ($encoded); ?>
The above example will output
something similar to:
Unicode semantics: 1
The string itself: ŐŹ
The length of the string: 2
Notes
Warning
This function is
EXPERIMENTAL. The behaviour of this function, its name, and
surrounding documentation may change without notice in a future release of PHP.
This function should be used at your own risk.