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

Is this question broken?

The question asks for you to combine the first two variables to set $fullName equal to the string "Rasmus Lerdorf". But when I run my code, it says that $fullName nedds to be set to "Rasmus Lerdof". If I change $lastName to "Lerdof", it says that the first condition is no longer correct because $lastName now equals "Lerdof" instead of "Lerdorf".

Please help...

I really just want to quickly get through the basics of PHP so I can learn to embed SQL.

index.php
<?php

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


?>

3 Answers

Antonio De Rose
Antonio De Rose
20,885 Points
<?php
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullName = $firstName." ".$Last_Name; #why do you have an underscore, between last and Name

Antonio is right, but I also struggled with this question. It is extremely finicky. I had to tweak it for 20 min before I got the right answer. It had to do with my spacing between the concatenation between my $fullName variable and the sentence that needed to go at the end of it.

Hope this helps. Good luck

Hi Ryan! Can you please show me like Antonio in code? Because I really cant go thought this exercise, I tried over and over again but like Nathan said I always get an error because of the Lerdorf or Lerdof.

Hope to hear from you soon.

Thank you

The correct code would be:

<?php
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullName = $firstName . " " . $lastName;