D
dman_2007
Guest
PHP supports eight data types :
Four scalar types :
two compund types :
and finally two special types :
You can find out a variable or expressions value and type bu using var_dump function, gettype function can also be used for finding out the type of a variable.
If you want to converta variable to a specific data type you can use settype function. Alternatively you can aslo cast it to a different type. You can use following casts to convert a variable to your desired data type in php :
Four scalar types :
- boolean
- integer
- float
- string
two compund types :
- array
- object
and finally two special types :
- resource
- null
You can find out a variable or expressions value and type bu using var_dump function, gettype function can also be used for finding out the type of a variable.
If you want to converta variable to a specific data type you can use settype function. Alternatively you can aslo cast it to a different type. You can use following casts to convert a variable to your desired data type in php :
- (bool), (boolean)
- (int), (integer)
- (float) (real), (double)
- (string)
- (array)
- (object)