PHP Data Types

PHP supports total of eight data types which we use to define our variables:

  • Integers: Whole numbers, without a decimal point.
  • Doubles: Floating-point numbers, like 5.234 or 3.25.
  • Booleans: True or False.
  • NULL: Special type that only has one value: NULL.
  • Strings:Sequences of characters.
  • Arrays: An indexed collections values.
  • Objects: Instances of a user defined classes, which can encapsulate properties and data that are specific to the class.
  • Resources: Hold references to resources external to PHP (such as database connections).