settype (PHP 3, PHP 4 )settype -- Set the type of a variable Description bool settype ( mixed var, string type) Set the type of variable var to type. Possibles values of type are: "boolean" (or, since PHP 4.2.0, "bool") "integer" (or, since PHP 4.2.0, "int") "float" (only possible since PHP 4.2.0, for older versions use the deprecated variant "double") "string" "array" "object" "null" (since PHP 4.2.0) 如果成功则返回 TRUE,失败则返回 FALSE。
(PHP 3, PHP 4 )settype -- Set the type of a variable
Description
bool settype ( mixed var, string type)
Set the type of variable var to type. Possibles values of type are:
"boolean" (or, since PHP 4.2.0, "bool") "integer" (or, since PHP 4.2.0, "int") "float" (only possible since PHP 4.2.0, for older versions use the deprecated variant "double") "string" "array" "object" "null" (since PHP 4.2.0)
如果成功则返回 TRUE,失败则返回 FALSE。
echo settype($var,"string"); // 1 表示成功var_dump($var); //string(2) "39"