Set the type of a variable
&$var
$type
Set the type of variable var to type.
var
type
The variable being converted.
Possibles values of type are:
Returns TRUE on success or FALSE on failure.
TRUE
FALSE
Example #1 settype example
<?php$foo = "5bar"; // string$bar = true; // booleansettype($foo, "integer"); // $foo is now 5 (integer)settype($bar, "string"); // $bar is now "1" (string)?>
Note: Maximum value for "int" is PHP_INT_MAX.
Note:
Maximum value for "int" is PHP_INT_MAX.
PHP_INT_MAX