PHP is_string() Function
is_string() The function is used to check whether a variable is a string.
PHP version requirement: PHP 4, PHP 5, PHP 7
Syntax
bool is_string ( mixed $var )
Parameter Description:
- $var: the variable to check.
Return Value
If the specified variable is a string, returns TRUE; otherwise returns FALSE.
Example
Example
The output is:
这是一个字符串。
bool(true)
bool(true)
bool(false)
bool(false)
Available PHP Functions