(PHP 6 >= 6.0.0)
is_unicode — Finds whether a variable is a unicode string
The variable being evaluated.
Returns TRUE if var is a unicode string, FALSE otherwise.
Example #1 is_unicode() example
<?php
// Declare a unicode string
$unicode = 'This is a unicode string';
// Declare a binary string
$binary = b'This is a binary string';
var_dump(is_unicode($unicode), is_unicode($binary));
?>
위 예제의 출력:
bool(true) bool(false)