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 trialMiguel Nunez
3,266 PointsCreate a third string named 'fullname' and use the $firstName and $lastName variable
Bummer! It looks like you forgot to add a space between the first and last name
$firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullname = $firstName . $lastName;
What i'm I doing wrong here?
<?php
//Place your code below this comment
?>
itai chiriseri
5,127 Pointsyou need to add space when concatenating your strings so it should be $firstName.' '.$lastName;
hassan alzahrani
3,623 PointsYou need to add space in between the names so the result instead of : RasmusLerdorf will be: Rasmus Lerdorf
As following: $fullname = $firstName . ' '.$lastName;
4 Answers
Gabor Gazdag
10,474 PointsHi Miguel!
The solution would be: $firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullname = $firstName .' '.$lastName;
My suggestion would be to set all of your varibales in a new row, it makes your code more readable.
Cheers, Gabor
Miguel Nunez
3,266 PointsThanks guys all your answers helped out I need help with another one
Use the $fullname variable to display the following string to the screen. Use an escape character to add a newline to the end of the string. 'Rasmus Lerdorf was the original creator of PHP'
$firstName = 'Rasmus'; $lastName = 'Lerdorf'; $fullname = $firstName .' '.$lastName;
Jamie Touton
7,051 PointsYou need to concatenate the two variables by using a period inbetween them.
$fullName = $firstname . $lastName;
amisha prajapati
4,484 Points$firstName='Rasmus'; $lastName='Lerdorf'; $fullname = $firstName. ' ' . $lastName;
Ulan Assanoff
9,922 PointsUlan Assanoff
9,922 PointsActually you need some space while joining two strings, something like this $fullName = $firstName .' '. $lastName;