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 trialBrad Barnes
Courses Plus Student 2,916 PointsWhat am I missing
When I check this code in the workspace or if you look at it in preview is displays what it is ask, but it tells me that previous task is no good.
<?php
//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullname = "'$firstName $lastName";
$fullname = $fullname . " was the original creator of PHP' \n";
echo $fullname;
?>
2 Answers
Pedro Cabral
Full Stack JavaScript Techdegree Student 23,916 PointsYou have two problems: 1st: first time you declare full name it's not done properly, it should be $var1 . " " . $var2 or "{$var1} {$var2}" 2nd: in the last task you are not meant to reassign the variable, that's why task2 won't parse then. You should output it with text: $var . "something" or "{$var} something"
Sam Baines
4,315 PointsFull code for passing the challenge incase you need it.
<?php
//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullname = $firstName . ' ' . $lastName;
echo($fullname . ' was the original creator of PHP' . "\n");
?>
Brad Barnes
Courses Plus Student 2,916 PointsBrad Barnes
Courses Plus Student 2,916 PointsThanks for help