PHP includes several functions that can determine the type of variable, such as: GetType (), Is_array (), Is_float (), Is_int (), Is_object (), and is_string ().
Copy CodeThe code is as follows:
$s = "This is a string";
$i = 9;
$arr = Array (2,4,6);
Is_string ($s); Returns true, indicating that $s is a string variable
Is_string ($i); Returns false, indicating that $i is not a string variable
Is_array ($arr); Returns True, indicating that $arr is an array
Is_array ($s); Returns false, indicating that $s is not an array
$str = "This is a string";
$int = 9;
$bool = FALSE;
The type of echo "\ $str is:". GetType ($STR);
echo "
";
echo "
";
The type of echo "\ $int is:". GetType ($int);
echo "
";
echo "
";
The type of echo "\ $bool is:". GetType ($bool);
?>
http://www.bkjia.com/PHPjc/320751.html www.bkjia.com true http://www.bkjia.com/PHPjc/320751.html techarticle PHP includes several functions that can determine the type of variable, such as: GetType (), Is_array (), Is_float (), Is_int (), Is_object (), and is_string (). Copy the code as follows: Php $s = "th ...