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

Jan-Willem Ligtelijn
seal-mask
.a{fill-rule:evenodd;}techdegree
Jan-Willem Ligtelijn
iOS Development Techdegree Student 2,905 Points

Challenge task 3 of concatenation

Hello,

I'm doing the challenge in between video's about PHP basics and now i'm working on the challenge about concatenation and i don't know what i'm doing wrong. Task 1 and 2 are good and then when i submit my answer for task 3 i get the message "Oops! It looks like tast 2 is no longer passing.". I tried everything and talked about it with colleages and they say that it's good what i have filled in. I have used the following code: $firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullName = $firstName .' '. $lastName; $fullName .= ' was the original creator of PHP' ."\n"; echo $fullName;

Can you see what is wrong with this answer? Thanks for your help. Greetings Ej

index.php
<?php

//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = $firstName .' '. $lastName;
$fullName .= ' was the original creator of PHP' ."\n";
echo $fullName;
?>

1 Answer

Instead of adding the extra string (Rasmus being the creator of PHP) to the fullName variable which changes it to no longer just being Rasmus Lerdorf just use the fullName variable in your echo statement

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