Subscriber only lesson.
Sign up to this course to view this lesson.
String operators allow you to concatenate strings together.
When to use
Any time you want to chain together strings, use the (.) string operator.
When we talk about string operators, we're usually talking about concatenation using the (.) period.
$first = "John";
$last = "Elder";
echo $first . $last;
You can also concatenate and assign using:
Hints & tips
- concatenate with a period
- concatenate and assign with .=
Lesson notes are only available for subscribers.