how to know variable type in php code example Example: check type in php gettype ( mixed $var ) : string