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

Javier Pons
Javier Pons
15,010 Points

PHP concatenation . Everything seems fine but says task2 is no longer passing

whats wrong ?

index.php
<?php

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

3 Answers

Julian Gutierrez
Julian Gutierrez
19,201 Points

The variable $fullname should only contain the string "Rasmus Lerdorf" meaning that " was the original creator of PHP" should be added in your echo statement.

Javier Pons
Javier Pons
15,010 Points

that makes more sense .. i mean , that the variable full name should only contain the full name .. Thank you

Julian Gutierrez
Julian Gutierrez
19,201 Points

No need for the assignment operator in your last line, what you are needing to do is echo out the concatenated string.

Javier Pons
Javier Pons
15,010 Points

Good! .. i was missing the echo part .. still does not pass task 2 . this is my code

<?php

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

echo $fullname;
?>
Angela Visnesky
Angela Visnesky
20,927 Points

Hi Javier! $fullname should be the first and last names with a space between. "Was the original creator..." is combined in the echo $fullname part.

<?php
//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullname = $firstName . " " . $lastName; 

echo $fullname . " was the original creator of PHP\n";
?>

I hope this helps!

Javier Pons
Javier Pons
15,010 Points

Thank you Angela. I actually passed the challenge with julian's answer.