Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJustin Armstrong
3,702 Pointsphp concatenation task 2 of 3
I don't understand the part about the spaces, what do I need to do?
<?php
//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf" ;
$fullName = $firstName . $lastName ;
?>
2 Answers
jamesjones21
9,260 Pointssure I can: example
$fullName = $firstName . ' Space is in here between single or double inverted commas ' . $lastName ;
how it should look
$fullName = $firstName . ' ' . $lastName ;
jamesjones21
9,260 PointsTo add a space to a concatenated string you just add . ' ' .
So where the firstname and last name is just add the above between it, so it will be a single quote space and single quote. This will then create the space between the variables.
Justin Armstrong
3,702 PointsCan you please show me an example because I am still having trouble understanding what you mean?