settype()
Set the type of a variable. See the entry on type casting for details.
The variable itself is altered to reflect the change. Only true or false is returned (success or failure). Allowed types:
- bool
- boolean
- int
- integer
- float
- string
- array
- object
- resource
- null
$a = 1; $b = 'false'; $c = 0; $d = true; $e = 'monkey'; $f = 17; settype($a, 'bool'); // true settype($b, 'int'); // 0 settype($c, 'string'); // '0' settype($d, 'string'); // '1' settype($e, 'array'); // array(0=>'monkey') settype($f, 'null'); // null
