About Lesson
Data types are used to carry various types of data or values. PHP supports 8 primitive data types that can be categorized into 3 types:
- Scalar Types (predefined)
- Compound Types (user-defined)
- Special Types
Scalar Types (predefined)
It stores only a single value. There are 4 scalar data types in PHP.
- boolean
- float
- integer
- string
Compound Types (user-defined)
Compound data types can store multiple values. PHP supports two types of compound data types.
- array
- object
Special Types
PHP supports two types of compound data types.
- resource
- NULL