PHP Data Types
Use this lesson when you want to understand the key concepts behind PHP Data Types.
Variables can store data of different types, and different data types can do different things.
PHP supports the following data types:
To inspect the data type and value of a variable, use the var_dump() function. This is an incredibly useful function for debugging!
<?php $x = 5985; var_dump($x);echo "\n";
$y = "Hello"; var_dump($y); ?>
Null is a special data type which can have only one value: NULL.
A variable of data type NULL is a variable that has no value assigned to it. If a variable is created without a value, it is automatically assigned a value of NULL.
Which function is used to return the data type and value of a variable?