Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
218,861 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
218,861 Points

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