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 PHP Basics Daily Exercise Program String Manipulation

$fullName should equal Rasmus Lerdorf


//Place your code below this comment

$firstName = "Rasmus";
$lastName = "Lerdorf";

$fullName = "Hello $firstName  $lastName";

echo $fullname;

2 Answers

Steven Parker
Steven Parker
229,921 Points

Try leaving out the "Hello " and use only one space between the names.

And you don't need to "echo" anything until task 3 (and then you'll construct a whole sentence).

Try to concatenate your string.

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

If you need me explain how this works please let me know. Thank You.

Steven Parker
Steven Parker
229,921 Points

Concatenation is another approach (and would also work), but you'd still need to leave off the "Hello "! :see_no_evil: