php man page for settype

Query: settype

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

SETTYPE(3)								 1								SETTYPE(3)

settype - Set the type of a variable

SYNOPSIS
bool settype (mixed &$var, string $type)
DESCRIPTION
Set the type of variable $var to $type.
PARAMETERS
o $var - The variable being converted. o $type - Possibles values of $type are: o "boolean" (or, since PHP 4.2.0, "bool") o "integer" (or, since PHP 4.2.0, "int") o "float" (only possible since PHP 4.2.0, for older versions use the deprecated variant "double") o "string" o "array" o "object" o "null" (since PHP 4.2.0)
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1 settype(3) example <?php $foo = "5bar"; // string $bar = true; // boolean settype($foo, "integer"); // $foo is now 5 (integer) settype($bar, "string"); // $bar is now "1" (string) ?>
NOTES
Note Maximum value for "int" is PHP_INT_MAX.
SEE ALSO
gettype(3), type-casting, type-juggling. PHP Documentation Group SETTYPE(3)
Related Man Pages
strval(3) - php
intval(3) - php
apc_add(3) - php
apc_store(3) - php
empty(3) - php
Similar Topics in the Unix Linux Community
pthread_mutex_trylock() overwrites global variable on CentOS5
awk help
Help with awk issue
Need help in mysql query
Need help in mysql query