PHP Data Types


A data type is defined as a set of entities and the allowable operations on those values. Almost all programming languages explicitly include the notion of data type, though other languages may use different terminology.

And PHP has defined several data types.

Main PHP data types are:

- Boolean

- Integer

- String

- Array

- Object

- Resource



Because PHP is a weakly-typed language all variables are writted with $ sign and without type before or after them. In order to fin a variable type, you can use var_dump($var) or gettype() function.

Add comment


Warning: Unknown: write failed: Disk quota exceeded (122) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0