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; // boolean settype($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