Query: gettype
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GETTYPE(3) 1 GETTYPE(3) gettype - Get the type of a variableSYNOPSISstring gettype (mixed $var)DESCRIPTIONReturns the type of the PHP variable $var. For type checking, use is_* functions.PARAMETERSo $var - The variable being type checked.RETURN VALUESPossible values for the returned string are: o " boolean" o " integer" o " double" (for historical reasons "double" is returned in case of a float, and not simply "float") o " string" o " array" o " object" o " resource" o " NULL" o "unknown type"EXAMPLESExample #1 gettype(3) example <?php $data = array(1, 1., NULL, new stdClass, 'foo'); foreach ($data as $value) { echo gettype($value), " "; } ?> The above example will output something similar to: integer double NULL object stringSEE ALSOsettype(3), get_class(3), is_array(3), is_bool(3), is_callable(3), is_float(3), is_int(3), is_null(3), is_numeric(3), is_object(3), is_resource(3), is_scalar(3), is_string(3), function_exists(3), method_exists(3). PHP Documentation Group GETTYPE(3)
Related Man Pages |
---|
filter_var(3) - php |
apc_add(3) - php |
empty(3) - php |
is_callable(3) - php |
parsekit_func_arginfo(3) - php |
Similar Topics in the Unix Linux Community |
---|
ksh : find value type |
getting type of variable |