← PHP learning pathPHP · Module 2 of 10
Variables, types and strings
Store data and build strings.
📖 Key ideas
- Variables start with $: $name = "Asha";
- Types: int, float, string, bool, array, null.
- Double quotes interpolate: "Hi $name"; single quotes don't.
- Concatenate with the dot operator: "Hi " . $name.
- var_dump shows type and value.
💡 Real-life example: PHP variables wear a $ badge so the server can spot them easily.
$variablePHP variable syntax
ConcatenationJoining strings with .
var_dumpShows type and value
InterpolationVariables inside double-quoted strings