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

dale das
dale das
1,262 Points

Keeps saying task 2 won't pass even though syntax should be right

can someone check my syntax - I believe I typed everything correct but I"m still getting a no-go.

index.php
<?php

//Place your code below this comment
$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = "$firstName $lastName" . "was the original creator of PHP" . "\n";

echo $fullName;

?>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Your syntax is just fine, however, it's asking you to echo out the value of the variable $fullName in conjunction with the string it gave. You are changing the value of the $fullName variable to be the entire thing, which is partially what is causing this to not pass. Also, you've forgotten to account for a space between the full name and the rest of the string.

Now, without changing the value in $fullName that you had at step two, echo out the full name and the string it gave. Don't forget the space!

I think you can get it with these hints, but let me know if you're still stuck! :sparkles:

dale das
dale das
1,262 Points

I see where I went wrong - I didn't realize you could concact to a variable in an echo element. I've spend two hours on the past two problems you're a lifesaver!