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

It looks like task 2 is no longer passing

//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullname = "$firstName $lastName";
$fullname = "'$fullname was the original creator of PHP'\n";
echo $fullname;
?>```

task 2 was to create the fullname variable, then in task 3 it says that it is no longer passing.
It looks right to me in the preview but there is something I am missing

```index.php
<?php

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

2 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Hi there.

Hmm ... for some reasons, there's duplicate codes in the code you posted.

The problem is this line in your code

$fullname = "'$fullname was the original creator of PHP'\n";

In this particular line, the value of the $fullname variable written during part 2 was modified, that's the cause of part 2 failing to pass the grader check. You can solve the part 3 in one-line using ehco without the need of creating or modifying any variables.

<?php

//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullname = "$firstName $lastName";
echo "$fullname was the original creator of PHP\n"
?>

Hope it helps.

Daniel Stopka
Daniel Stopka
13,520 Points

Hi Christopher,

the second task is no longer passing, because you have change the $fullname variable to contain text. Instead of this approach, try to use echo $fullname . "text";