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.
Scalar Types :- There are 4 scalar data types in PHP. It holds only single value.
user-defined :- There are 2 user-define data types in PHP. It holds multiple value.
Special Types :- Two Special datatype in PHP.
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 :-
Integer Data Type Example :-
File Name :
Output :-
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.
File Name : index.php
Output :-
Boolean
In PHP a boolean data can be either TRUE or FALSE. TRUE and FALSE are predefined constants in PHP. Boolean constants are not case sensitive. That means TRUE is equivalent to true and FALSE is similar to False.
Example
Output :-
Output :-
Output :-
Array Data type :-
Trending Tutorials