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

Why is this not displaying correctly?

What is it that I am doing that this is not displaying the correct function?

index.php
<?php

//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";

$fullName .= "$firstName $lastName";

echo "'$fullName 'was the original creator of PHP.\n";


?>

2 Answers

There are a couple of issues going on.

One: you need to concatenate your variables by using the . operator. Using .= does not concatenate the two vars into two words, it concatenates it into one word you need a space between the first and last name.

Second: if you use a variable you do not apply strings tags to it. Write the variable then add in this case double quotes due to using \n.

Your on the right track, just a couple of changes are needed.

Thanks, I was able to sort it out.