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

daniel Couzens
daniel Couzens
4,759 Points

task 3?!

I though this would solve my issue but no joy! Can anyone help?

index.php
<?php

//Place your code below this comment

$firstName = 'Rasmus';
$lastName = 'Lerdorf';

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

echo $fullName;
?>

1 Answer

You are awful close but if you stop and think about it for a minute if you wanted to show this person's first name a second time on a page it wouldn't make complete sense right? Because you have his name and then some other stuff after it. What you're really after is this:

<?php

//Place your code below this comment

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

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

This way you can also echo this without it having that he was also the creator of PHP the second time

<?php
echo $fullName . " has a really awesome first name.\n";