PHP settype() Function

PHP Variable Handling Reference : Convert variables to specific types

Definition and Usage

The settype() function converts a variable to a specific type.

Syntax

settype(variable, type);

Parameter Values

Parameter Description
variable Required. Specifies the variable to convert
type Required. Specifies the type to convert variable to. The possible types are: boolean, bool, integer, int, float, double, string, array, object, null 

Technical Details

Return Value: TRUE on success, FALSE on failure
Return Type: Boolean
PHP Version: 4.0+

❮ PHP Variable Handling Reference