PHP data types define what types of data used in your application. and what types of data used in appliaction.
Each variable contain a specific data type.
PHP Support 8 types of datatypes.
Integer
Float
String
Boolean
Array
Object
Resource
NULL
Scalar Types :- There are 4 scalar data types in PHP. It holds only single value.
Integer
Float
Boolean
String
user-defined :- There are 2 user-define data types in PHP. It holds multiple value.
Array
Object
Special Types :- Two Special datatype in PHP.
Resource
NULL
Integer Data Type :-
Integer data type contain numeric value (negative or positive) . integer data type store only numeric numbers, i.e., numbers without fractional part or decimal points.
Integer creation Rules :-
An integer can be either positive or negative.
An integer must have at least one digit
An integer must not contain decimal point.
Integers can be specified in: decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2) notation
An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647
water temperature : 98
Ice Temperature : -2
Decimal number : 84
Octal number : 434
HexaDecimal Number : 32
Float Data Type
A Floatin-ponit number is a number which contain decimal point. it hold numbers with a fractional or decimal point, including a negative or positive sign.