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
Remove the four underscores in the echo command and concatenate the remaining text with the variable $fullName.
$firstName = "Mike"; $middleName = "the"; $lastName = "Frog";
echo "The designer at Shirts 4 Mike shirts is named" . " " . $fullName ; $fullName = $firstName . " " .$middleName . " " .$lastName;
?> this is what i got. what am i doing wrong?
Keith Kelly21,326 Points
You are pretty close with your answer there are a couple issues that you would need to address.
- Establish the fullName variable prior to the echo command
- After named you don't need to concatenate the space. You can simply add a space after the named before the quotes.
The code would look something like this:
<?php $firstName = "Mike"; $middleName = "the"; $lastName = "Frog"; $fullName = $firstName . ' ' . $middleName . ' ' . $lastName; echo "The designer at Shirts 4 Mike shirts is named " . $fullName; ?>
Hope that helps!
Calvin Williams2,174 Points
This is it.
<?php $lastName = "Frog"; $firstName = "Mike"; $middleName = "the"; $fullName = "$firstName " . "$middleName " . $lastName; echo "The designer at Shirts 4 Mike shirts is named $fullName"; ?>