In php four data types
- Boolean
- Integer
- Float
- String
This data type can represent either true or false . In PHP value is 1 and value of false doesn’t any value.
is_bool : Using this function , we can check input variable is boolean or not.
(bool) var OR (boolean) var using this function , we convert variable into boolean variable.
This data type can store numeric value
is_int OR is_integer it is used to cheak input variable is integer or not .
(int)var ))OR (integer) var OR intval(var) Using this function , we convert variable into integer variable.
this data type can store decimal values .
is_float () this function cheacks input variuable is float or not.
(float)var Converts a variable into floating point number.
It is a collection of character.
In PHP , we can declar string in three ways.
- By using single quotations
- By using double quotations
- By using heredoc syntax
NOTE Variable in double quotations returns value of variables.
Heredoc PHP suports heredoc syntax to avoid the conflicts what we getting with single and double quotations.
Compound data types