September 2001
Intermediate to advanced
768 pages
32h 45m
English
string gettype(mixed value) Finds the type of a value.
Returns:
String containing the type of the value
Description:
gettype() returns the type of the value argument. The value returned is one of integer, double, string, array, class, object, unknown type, or NULL.
Version:
3+, 4+
Examples:
// $value has not been defined - let's see what type it is $type = gettype ($value); print "The type of variable <i>\$value</i> is <i>$type</i>."; |
<pre> <?php // Make a list of values to test $values = array ( 'array (1,2)' => array (1,2), 'TRUE' => TRUE, 1.23 => 1.23, 1 => 1, '0xFF' => 0xFF, 'NULL' => NULL, "dir('.')" => dir('.'), "opendir ('.')" => opendir ... |
Read now
Unlock full access