PHP Data Types are used to define the type of data that is to be stored. PHP data types can be classified into 3 groups:
● Scalar Data Types:
● Compound Data Types:
● Special Data Types:
A sequence of characters is called as string. A string should be written inside a single or double quote.
All the non-decimal numbers between -2,147,483,648 and 2,147,483,647 are called as Integers.
Float represents all the decimal and exponential numbers.
The boolean data type can only take two values, either TRUE or FALSE.
Array is used to store multiple data of same data type in the name of a single variable.
An object defines how a data need to be processed.
A NULL data types holds a NULL value.
It is not an actual data type. It is used to store external references and resources.
<!DOCTYPE html> <html> <body> <?php $x = "Hello world!"; $y = 5000; $z = 10.01; $w = array("a","b","c"); $v = null; var_dump($x); var_dump($y); var_dump($z); var_dump($w); var_dump($v); ?> </body> </html>