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 trialFrank Muvambi
5,203 PointsCreate a variable called fullName and assign it a value equal to the concatenation of the firstName variable, a space, t
Create a variable called fullName and assign it a value equal to the concatenation of the firstName variable, a space, the middleName variable, a space, and the lastName variable.
3 Answers
Matt Brock
28,330 PointsLike how to do it? The dot in php links, or concatenates, two things together. You have to manually add the spaces between the double quotes. Here's a simple example:
$three = 3;
$four = 4;
// $three . $four gives you 34
As for your question, this worked for me:
$fullName = $firstName . " " . $middleName . " " . $lastName;
Frank Muvambi
5,203 Points$fullName = ."".$firstName."".$middleName.""$lastName;
Jeff Lemay
14,268 PointsYou're not including spaces between the variables. You need a space inside your quotes: $firstName." ".$middleName
I like to space things out a bit so it's easier to read also: $firstname . " " . $middleName
It looks like there are a couple other issues as well, but I'll leave you to complete it. Watch the video again, the examples they provide will directly relate to what you need to do (just change variable names).
Edit: See Matt's answer below for the solution
Matt Brock
28,330 PointsFrank, what is your question?
Frank Muvambi
5,203 PointsCreate a variable called fullName and assign it a value equal to the concatenation of the firstName variable, a space, the middleName variable, a space, and the lastName variable.
Frank Muvambi
5,203 PointsFrank Muvambi
5,203 PointsThanks Matt, you have been so helpfull. moving on now.
Matt Brock
28,330 PointsMatt Brock
28,330 PointsThanks Frank! Glad to help.