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

Leonardo Da Costa
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Leonardo Da Costa
Front End Web Development Techdegree Graduate 14,559 Points

It looks like Task 2 is no longer passing.

Don't know what I am missing, and instruction are not really clear. Does it have to be 'Rasmus Lerdorf was the original creator of PHP' or simply Rasmus Lerdorf was the original creator of PHP.

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;

?>

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Leonardo,

First off, always ignore the "It looks like Task # is no longer passing," and always resist the urge to click "Go To Task #"

This is a very misleading error, but almost always means you have a syntax error on the current task you are working on.

In this case, it's a couple of things. First, you need to echo out the sentence to the screen, but you are trying to re-assign the string back to the $fullname variable (which is where the syntax error is).

Second, no, you don't need the quotes in the string. In the Instructions, it just puts into quotes what it wants you to echo.

So, the line you are needing is below for your reference. Have a look, and I hope it makes sense!

echo $fullname . " was the original creator of PHP\n"

Keep Coding! :) :dizzy:

Leonardo Da Costa
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Leonardo Da Costa
Front End Web Development Techdegree Graduate 14,559 Points

Yeah man I had a hard time on this one, it was working on my workspace but not on the challenge editor. I eventually started guessing all possible inputs and got it right at some point. Thanks for the answer man, helped me with what i should look out in the future with challenges. Have a good one, and keep coding !