strings
$name = "mahmoud";
echo strtoupper($name);
Output:
MAHMOUD
Interpolation
echo "$name joined\n";
echo "{$name}s tools\n";
Double quotes expand variables Single quotes do not Braces remove ambiguity when a letter follows the variable name
Concatenation
echo $name . ":" . 443;
The dot operator is explicit Interpolation is usually easier to read for short strings
Helpers
strlen($name);
str_contains("payload:443", "443");
str_contains is the modern membership check
Do not reach for a regular expression when a substring test is enough
Next
Decisions in 05 control
Posted