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 trialMika Laakso
4,222 PointsThe code does not work
Why does it not work?
<?php
//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullName = $firstName . ' ' . $lastName
echo $fullName . ' ' . "was the original creator of PHP"\n;
?>
3 Answers
Ben Payne
1,464 PointsHey Mike - You're missing a semi colon after the $fullName
assignment. You also need to put the \n
inside the double quotes and you can just concatenate the second part of the string with a space at the beginning:
<?php
echo $fullName . " was the original creator of PHP\n";
João Rosa
2,629 PointsHey!
You are missing a semi-colon at the end of this statement:
<?php
$fullName = $firstName . ' ' . $lastName
That's probably the problem.
Mika Laakso
4,222 PointsThank you guys for the help!
João Rosa
2,629 PointsJoão Rosa
2,629 PointsOh, I missed the \n inside the double quotes! Thanks for catching that.