php datatypes
php datatypes
categories. PHP has a total of eight data types that we use to construct our
variables −
The first five are simple types, and the next two (arrays and objects) are
compound types. The compound types can package up other arbitrary
values of arbitrary type, whereas the simple types cannot.
In this chapter, let's discuss in detail about these built-in data types of PHP.
A whole number without a decimal point (like 4195) is of int type in PHP.
Integer data types are the simplest type. They correspond to simple whole
numbers, both positive and negative.
An int is a number of the set Z = {..., -2, -1, 0, 1, 2, ...}.
An int can be represented in a decimal (base 10), hexadecimal (base 16),
octal (base 8) or binary (base 2) notation.