BBM Tutor
BBM Tutor

PHP Data Types

PHP supports several different types of data like Scalar data types, Compound data types, Special data types and Pseudo data Types. They are listed below.

Scalar Data Types

Data Types

Description

boolean

Boolean holds the truth value either TRUE or FALSE. Both are case-insensitive - 1 Byte

integer

Integer holds the numeric value without a fractional or decimal component (i.e., a Rounded Number without a decimal point) - 2 Bytes

float

Floating Point Number - Float, Double or Real holds the numeric value with a fractional or decimal component (i.e., a number containing a decimal point and/or an exponent) - 4 Bytes

string

It holds a sequence of characters - 1 Byte per character

Compound Data Types

Data Types

Description

array

Array holds the multiple data items that have common characteristics (e.g., a set of numerical data or any scalar data, represented by a1, a2, a3, ... an).

object

An object is a compound data type that can contain any number of variables and functions.

Special Data Types

Data Types

Description

resource

A resource is a special variable, holding a reference to an external resource lika a text file or any other document file, image, zip archive, etc.,

NULL

The special NULL value represents that a variable has no value. NULL is the only possible value of type NULL.

 
Disclaimer: Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.