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!
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
Having trouble with passing "Combining strings" objective.
I am having trouble with passing "Combining strings" third objective.
-There is the task which makes me mad :D
1) Use the $fullName variable to display the following string to the screen. Rasmus Lerdorf was the original creator of PHP
2) Use an escape character to add a newline to the end of the string.
-There is on of my solutions (This one is in my opinion the closest one to the right solution).
//Place your code below this comment
------> These two are pre-tasks
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = "$firstName $lastName";
------> This one is the one I have trouble with
$task3 = "$fullName was the original creator of PHP /n";
I already can see that I made stupid mistake and I will look like an idiot :D but despite trying really hard and watching video about combining strings like three or four times I still cannot put together the right solution.
The result is that I cannot progress to next steps and also I am slowly but surely getting bored about all this thing.. :(
I hope you will save me.
Thank you for all the answers I will get mates.)
Henrik ChristensenPython Web Development Techdegree Student 38,322 Points
Try something like this:
<?php $firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = "$firstName $lastName"; echo "$fullName was the original creator of PHP\n"; ?>
//Place your code below this comment $firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullName .= "$firstName $lastName"; ?>```
Yes, it seems like the best way to learn, thank you for your time:)