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 trialKevin Parine
2,402 PointsWhy is this not displaying correctly?
What is it that I am doing that this is not displaying the correct function?
<?php
//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullName .= "$firstName $lastName";
echo "'$fullName 'was the original creator of PHP.\n";
?>
2 Answers
Jacob Mishkin
23,118 PointsThere are a couple of issues going on.
One: you need to concatenate your variables by using the . operator. Using .= does not concatenate the two vars into two words, it concatenates it into one word you need a space between the first and last name.
Second: if you use a variable you do not apply strings tags to it. Write the variable then add in this case double quotes due to using \n.
Your on the right track, just a couple of changes are needed.
Kevin Parine
2,402 PointsThanks, I was able to sort it out.