September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool settype(mixed $variable, string type)
Converts a variable to a given type.
Returns:
TRUE if the given variable can be converted to the given type; FALSE if the type argument is not a valid type name
Description:
settype() converts a variable to the specified type . If the type parameter is not a valid type name, the conversion fails and the function returns FALSE.
Availability:
UNIX, Windows
Version:
3+, 4+
See also:
To find the type of a variable:
gettype()
Examples:
$title = '1001 Arabian Nights';
settype ($title, 'integer')
or die ('Could not convert $title from type <i>string</i> to type
<i>integer</i>');
print $title;
|
<pre> <?php // Make ... |
Read now
Unlock full access