bool is_string ( mixed $var )
is_string() checks whether a variable is a string or not.
※ available F/W version : all
Returns TRUE if $var is a string, otherwise FALSE.
<?php
$val1 = "100";
$val2 = 100;
$ret1 = is_string($val1);
$ret2 = is_string($val2);
if($ret1) echo "ret1 is a string\r\n"; // OUTPUT: ret1 is a string
else echo "ret1 is NOT a string\r\n";
if($ret2) echo "ret2 is a string\r\n";
else echo "ret2 is NOT a string\r\n"; // OUTPUT: ret2 is NOT a string
?>
is_array() / is_bool() / is_float() / is_int()
This function is identical to the PHP group’s is_string().