PHP 5 Data Types
PHP 5 Data Types
PHP Variables can store data of different types, and different data types can do different things.
- Array
- Object
- String
- NULL
- Float
- Boolean
- Integer
- Resource
We define only the types of information in a variable through data types. For example, if you want to store a number or a character, you represent the compiler through this data type.
- Strings are sequences of characters, where each character is the same as a byte.
- Booleans are like a switch, with only two possible values being true or false.
- Array is a variable that can hold more than one value at a time, for example there is a set of country or city names.
- An object is a data type. It stores data and information on how data is processed.
- A float is a number with decimal digits or a number in exponential form.
- Resource is a special variable that holds a reference to an external resource.