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 trial

PHP PHP Basics Daily Exercise Program String Manipulation

Vince Roszak
Vince Roszak
588 Points

Can not figure out what is wrong with my code

It saying i need to add a space between the first and last name but I dont know how to do that.

index.php
<?php

//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName .= $firstName;
$fullName .= $lastName;


?>

Try this:

<?php

//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = $firstName . $lastName;


?>

You must concatinate the two variables into the fullName variable as above.

I tested this out and it worked fine!

2 Answers

Angela Visnesky
Angela Visnesky
20,927 Points
$fullName = $firstName . " ". $lastName;

I hope this helps!

Vince Roszak
Vince Roszak
588 Points

i just tried doing that but it still says I need to add a space

The code I pasted in here works fine for me in the teamtreehouse compiler. Can you post your code as well as the error you are getting so I can help more?