The is_string() function is used to detect whether a variable is a string.
PHP version requirements: PHP 4, PHP 5, PHP 7
bool is_string (mixed $var)
Parameter description:
$var: The variable to be tested.
Returns TRUE if the specified variable is a string, otherwise returns FALSE.
The output is:
This is a string. bool(true)bool(true)bool(false)bool(false)