PHP Data Types

PHP Data Types

PHP provides eight types of data types. Four are single value types: integers, float, string, and boolean. Two are compound types: arrays and object and rest of two are special types: resource and NULL.

  • Integer
  • Float
  • String
  • Boolean
  • Array
  • Object
  • NULL
  • Resource

PHP Integer

Integer data type is a non-decimal number. Integer data type can be both positive or negative.

PHP Float

Integer data type is a decimal number data type. Float data type can be both positive or negative.

PHP String

A string data type is a sequence of characters or we can say it can be a sentence too. In string there can be letters, numbers, and special characters.

PHP Boolean

A Boolean data type stands for true and false. It have only 2 values 1(True) and 0 (false).