How to get PHP value type?

The gettype() function returns the type of a variable.


$a = 3;
echo gettype($a);
//integer

$b = 3.2;
echo gettype($b);
//double


$c = "Hello";
echo gettype($c);
//string

Comments

Leave a Reply