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!

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 Build a Simple PHP Application Adding a Contact Form Concatentation

Anything wrong with these codes below. $fullName = $firstName . "\n" . $midleName . "\n" . $lastName;

Anything wrong with these codes below. I was told to put spaces among those variables, but it doesn't go thru.

$fullName = $firstName . "\n" . $midleName . "\n" . $lastName;

$fullName = $firstName . "\n" . $midleName . "\n" . $lastName;
$lastName = "Frog";
$firstName = "Mike";
$middleName = "the";

echo "The designer at Shirts 4 Mike shirts is named ____";


2 Answers

Ken Alger
Ken Alger
Treehouse Teacher


Welcome to Treehouse!

You just need spaces, not newline characters. Remove the \n references and you should be good. Also, you need to define the $fullName variable after the other variables. Until then it won't know what $firstName, $middleName, or $lastName are or are equal to. Your $fullName variable assignment would then look like:

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

Happy coding,


Thank you very much! I love the teamtreehouse!

Hi Casey,

You have the $fullName variable set before the other 3 which means it won't be able to take their values as they haven't been set yet.

I also noticed you're missing a 'd' from $middleName in the concatenation line.

Your line under the 3 variables would then look something like:

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

Hope that helps


Thank you very much!

No problem, happy to help :)