PHP Data Types
1 min read
PHP Data Types
PHP supports several data types:
| Type | Example |
|---|---|
| String | "Hello" |
| Integer | 42 |
| Float | 3.14 |
| Boolean | true / false |
| Array | [1, 2, 3] |
| NULL | null |
<?php
$str = "text";
$int = 10;
$bool = true;
var_dump($int); // int(10)
Use var_dump() to inspect a variable's type and value while debugging.