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

Can't get past step 3. PHP is displaying properly.

Maybe I'm missing something, but I feel like I've followed the instructions to a tee but cannot pass. Am I doing something wrong? See below:

index.php
<?php

//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';

$fullName = "$firstName " . "$lastName " . 'was the original creator of PHP' .  "\n";

echo $fullName;
?>
Julian Perry
Julian Perry
2,186 Points

This is valid PHP code and runs without errors on my side. Best of luck getting this sorted out.

Hey Bryce,

Thanks for that. I played around with this earlier yesterday and figured it out as well. I believe the issue was that I did everything under the one variable, instead of concatenating and then appending the extra text afterwards like you said:

$fullName = "$firstName " . "$lastName";
echo "$fullName was the original creator of PHP \n";

2 Answers

Bryce Santos
Bryce Santos
11,144 Points

Also you need to use $fullName in the string.

$fullName = "$firstName " . "$lastName";
echo "$fullName was the original creator of PHP \n";
Bryce Santos
Bryce Santos
11,144 Points

Funny thing, I JUST had a problem with this as well. It actually doesn't want you to concatenate at all. Just write out the string! Hahaha!