php typeof string code example Example 1: typeof php gettype($var); Example 2: php is string is_string($var)