check datatype of variable in php code example Example: check type in php gettype ( mixed $var ) : string