Although PHP is loosely typed, it does support many common simple and structured data types. Simple data types are types that contain a range of values that can be ordered in one dimension (strings, numbers, Booleans, and so on), whereas structured data types include arrays and objects. PHP has eight simple types, which are described in the following table:

Data type Description
Boolean Scalar; either True or False
Integer Scalar; a whole number
Float Scalar; a number which may have a decimal place
String Scalar; a series of characters
Array Compound; an ordered map (contains names mapped to values)
Object Compound; a type that may contain properties and methods
Resource Special; contains a reference to an external resource, such as a handler to an open file
NULL Special; may only contain NULL as a value, meaning the variable; explicitly does not contain any value

Post By Gishore J Kallarackal (2,121 Posts)

Gishore J Kallarackal is the founder of techgurulive. The purpose of this site is to share information about free resources that techies can use for reference. You can follow me on the social web, subscribe to the RSS Feed or sign up for the email newsletter for your daily dose of tech tips & tutorials. You can content me via @twitter or e-mail.

Website: → Techgurulive

Connect