Understanding PHP Data Types
in PHP, there are altogether eight primitive data types supported: They are 4 scalar types, Boolean (Boolean), Integer (integer), float (float), and string (string), two conforming types, array (arrays), and Object (objects); Two special types, resource (Resource) and null (NULL).
The data type of a variable in PHP is usually not set by the programmer, and, to be exact, PHP is determined at runtime by the context in which it is used, which simply means that we do not need to set the data type of the variable and PHP will automatically recognize it.
Four types of scalar data
Boolean (Boolean)
Also called bool type, there are only two values, true or FALSE, which are not case sensitive
Strings (String type)
A string is a sequential sequence of characters, consisting of numbers, letters, and symbols.
Integer (integer type)
Integral is the integer that we often say, it can only be an integer
Float (float type)
Floating-point data types are our common decimals, which can be used either to store integers or to store decimals.
Two types of data compliance
Array (arrays)
An array is a combination of data that combines a series of arrays to form an operable whole.
Object (Objects)
object is an entity used to describe objective things in the system, which is a basic unit of the system. An object consists of a set of properties and a set of services that operate on that set of properties.
Two special types of
Resource (resources)
A resource is a special type of variable that holds a reference to an external resource, such as opening a file, a database connection, a graphics canvas area, and so on.
Null value (NULL)
NULL, in the name of which it simply does not have a value, which means that no value is set for the variable.
Above we have a simple understanding of the eight kinds of PHP raw data types, we will detail consider on these eight types of data, the next section, we first introduce you to four types of scalar data type "Boolean".