Welcome to the Treehouse Community
Looking to learn something new?
How do I combine $firstName = 'Rasmus'; and $lastname = 'Lerdorf'; to make $fullName = Rasmus Lerdorf?
Steven Parker216,057 Points
Joining strings together is called "concatenation", which was explored in detail in the video on Combining Strings. You may want to review that video.
The operator symbol for concatenation is a period ("."). It essentially acts like "glue" sticking two strings together to make one longer one. You can combine as many as you want in a single statement, and they can be a mix of literals (things in quotes) and variables containing strings.
I'll bet you can get it now, without an explicit "spoiler".
<?php $firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullName = $firstName.' '.$lastName; ?>
Exactly as Steven Parker mentioned, but figured I would provide a demonstration of how you would specifically concatenate strings in PHP.