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

Alexander Lawaetz
Alexander Lawaetz
10,859 Points

technology issue

After submitting my code for Challenge Task 2 of 3. I get the following response "Bummer! $fullName should equal Rasmus Lerdof"

If I change my $lastName variable to "Lerdof", task 1 will no longer be correct.

index.php
<?php

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

?>

1 Answer

Ivan Penchev
Ivan Penchev
13,833 Points

Its because you use variable firstname, while the variable is firstName. I also would advice to use different concatication method.

 $fullname = $firstName. ' ' . $lastName;
Alexander Lawaetz
Alexander Lawaetz
10,859 Points

Ivan Penchev - The issue have been fixed, and my code worked perfectly fine. Thanks for the answer through =)

edit: Why'd I use a different concatication method? Will my method not hold up in certain situations?

Ivan Penchev
Ivan Penchev
13,833 Points

Alexander Lawaetz it is not an "technology issue", its your code, so it cant be fixed by itself. You use a variable $fullname, such variable does not exist in your scope.

Your solution is slower, than mine, due to the way C# interpreting.