Variables start with a dollar sign. PHP's built-in types are:
<?php
$name = "Alice"; // string
$age = 30; // integer
$price = 9.99; // float
$active = true; // bool
$nothing = null; // null
$colours = ["red","green"]; // array
// Check a type at runtime
var_dump($price); // float(9.99)
gettype($age); // "integer"
is_string($name); // true
String concatenation uses the dot operator:
<?php
$greeting = "Hello, " . $name . "! You are " . $age . " years old.";
// Or use double-quoted strings with variable interpolation:
$greeting = "Hello, $name! You are {$age} years old.";
PHP will silently coerce types in arithmetic. Use strict comparison (===) to avoid surprises:
<?php
var_dump("2" + 3); // int(5) - string coerced to int
var_dump("2" == 2); // bool(true) - loose comparison
var_dump("2" === 2); // bool(false) - strict comparison (different types)