What are the types of variables present in PHP?

There are eight primary data types in PHP as shown below:

  • Array: A named and ordered collection of data
  • Boolean: A logical value (True or False)
  • Double: Floating point numbers such as 5.1525
  • Integer: Whole numbers without a floating point
  • Object: An instance of classes, containing data and functions
  • NULL: A special data type, supporting only the NULL data
  • Resource: Special variables that hold references to external resources
  • String: A sequence of characters such as, “Hello learners!”

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *