Variable handling 函数
PHP 手册

is_unicode

(PHP 6 >= 6.0.0)

is_unicodeFinds whether a variable is a unicode string

说明

bool is_unicode ( mixed $var )

Finds whether the given variable is a unicode string.

参数

var

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)

参见


Variable handling 函数
PHP 手册