Which function can we use to change the datatype of a variable in php?
(PHP 4, PHP 5, PHP 7, PHP 8) Show settype — Set the type of a variable Descriptionsettype(mixed Parametersvar The variable being converted. type Possibles values of
Return Values Returns ExamplesExample #1 settype() example
Notes
Special Notes ¶ 10 years ago
robin at barafranca dot com ¶ 14 years ago
sdibb at myway dot com ¶ 19 years ago
nospamplease at veganismus dot ch ¶ 17 years ago
Anonymous ¶ 3 years ago
DarkMaster ¶ 1 year ago
matt at mattsoft dot net ¶ 16 years ago
geoffsmiths at hotmail dot com ¶ 2 years ago
Skayo ¶ 5 years ago
ludvig dot ericson gmail.dot com ¶ 16 years ago
ns at canada dot com ¶ 22 years ago
NWdev ¶ 13 years ago
memandeemail at gmail dot com ¶ 17 years ago
Michael Benedict ¶ 16 years ago
marjune ¶ 5 years ago
= '0'; Chris Sullins ¶ 12 years ago
How do you change the type of data types in PHP?The settype() function is used to set the type of a variable. The variable being converted. Type of the variable. Possible values are : boolean, integer, float, string, array, object, null.
What is the use of Settype () and Gettype () function in PHP?The gettype() function gets the type of variable; gettype() is a function that display a data type. The settype function sets the type of variable; the settype() function changes the data type.
Which function is used for datatype and value in PHP?The gettype() function is an inbuilt function in PHP which is used to get the type of a variable. It is used to check the type of existing variable.
Which function can be used to know the data type of a variable?We can use the type() function to know which class a variable or a value belongs to.
|