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 trialnathanielmarquez8
Courses Plus Student 688 PointsThis is some silliness.
I typed out the code in brackets got the result that the quiz asked for but said was wrong.
read and re read on how the \n is to be used. https://stackoverflow.com/questions/13741485/n-or-n-in-php-echo-not-print}
<?php $firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullName = "$firstName" . " " . "$lastName" . " was the original creator of PHP"; echo $fullName; // I left this out of the quiz answer.
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = "$firstName" . " " . "$lastName";
$fullName = "$firstName" . " " . "$lastName" . " was the original creator of PHP";
echo $fullName; // I left this out of the quiz answer.
?>
When I attempted to add the "NEW LINE" I did so as follows. Making sure I used double quotes instead of single quotes.
This one made the most sense for what was being asked. $fullName = "$firstName" . " " . "$lastName \n " . " was the original creator of PHP"; This one made no sense but I was willing to try it. $fullName = "$firstName" . " " . "$lastName" . " was the original creator of PHP \n"; This one made sense also. $fullName = "$firstName" . " " . "$lastName" . "\n" . " was the original creator of PHP";
Thanks in advance for some input.
<?php
//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = "$firstName" . " " . "$lastName";
$fullName =
?>
2 Answers
Robert Bennett
11,927 Points$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = $firstName . ' ' . $lastName;
echo "$fullName was the original creator of PHP \n";
Robert Bennett
11,927 PointsNever give up! I hope you become a great programmer...
nathanielmarquez8
Courses Plus Student 688 PointsI wont, and thank you again. Cheers.
nathanielmarquez8
Courses Plus Student 688 Pointsnathanielmarquez8
Courses Plus Student 688 Pointsah now I see what needed to be done. The 1st task in part 3 was to Use the $fullName variable to DISPLAY aka ECHO the following string TO THE SCREEN.
Thank you Robert for your help once again.