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 trialJavier Pons
15,010 PointsPHP concatenation . Everything seems fine but says task2 is no longer passing
whats wrong ?
<?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
19,201 PointsThe variable $fullname should only contain the string "Rasmus Lerdorf" meaning that " was the original creator of PHP" should be added in your echo statement.
Julian Gutierrez
19,201 PointsNo need for the assignment operator in your last line, what you are needing to do is echo out the concatenated string.
Javier Pons
15,010 PointsGood! .. 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
20,927 PointsHi 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
15,010 PointsThank you Angela. I actually passed the challenge with julian's answer.
Javier Pons
15,010 PointsJavier Pons
15,010 Pointsthat makes more sense .. i mean , that the variable full name should only contain the full name .. Thank you