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 trial

PHP

Create 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

Like 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;

Thanks Matt, you have been so helpfull. moving on now.

Thanks Frank! Glad to help.

$fullName = ."".$firstName."".$middleName.""$lastName;

Jeff Lemay
Jeff Lemay
14,268 Points

You'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

Frank, what is your question?

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.