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

Nick Tsamis
PLUS
Nick Tsamis
Courses Plus Student 4,267 Points

where is the error in my code?

where is the error?

thanks:)

index.php
<?php

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

 $fullname = $firstName." ".$lastName. "was the original creator of PHP ";

?>

2 Answers

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

Hi there! You seem to have misinterpreted the last step of the challenge. You made the first name and last name then combined them into a $fullName. So far, so good. Now it wants you to use the $fullName inside of an echo statement to echo out that string. Also, it will require a newline character at the end as per the challenge instructions. However, you have assigned the entire string to the variable $fullName instead of echoing out that string.

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

Nick Tsamis
Nick Tsamis
Courses Plus Student 4,267 Points

its so simple but I stuck :)........LOL hahhah

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

I really wish I knew what you were stuck on :) But here is my solution:

<?php

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

$fullname = $firstName." ".$lastName;
echo "$fullname was the original creator of PHP\n";

?>

Now the first two parts you did just fine. It's the third part that's tripping you up somehow. We create an echo statement and then echo out the value stored in fullname together with was the original creator of PHP. At the very end we conclude the echo with the newline character.

Hope this helps! :sparkles:

Nick Tsamis
PLUS
Nick Tsamis
Courses Plus Student 4,267 Points

ok that's is the right solution :) thank you very much Jennifer :)!!!!!