For any queries you can reach us at infovistarindia@gmail.com / WhatsApp us: +919158876092

PHP Data Types

Overview

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:

  1. Scalar Types (predefined)
  2. Compound Types (user-defined)
  3. 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