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

john paul
john paul
3,191 Points

I cannot work out what is going wrong here? I get an error message that task 2 is not parsing.

I cannot work out what is going wrong here? I get an error message that task 2 is not parsing.

index.php
<?php

//Place your code below this comment

$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullName = $firstName . " " . $lastName . " " . "was the original creator of PHP.\n";
echo $fullName;
?>

2 Answers

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

Hi there! At the end of Task 2 the value stored in $fullName should be Rasmus Lerdorf. In step three you are overwriting that value. Now $fullName no longer contains just Rasumus Lerdorf but rather, "Rasmus Lerdorf was the original creator of PHP\n", and that's not his name :smiley:

Instead, echo out the string directly without replacing the $fullName variable.

For instance:

$myName = "Jennifer";
echo "Hi there, John! My name is $myName";

Hope this helps! :sparkles:

john paul
john paul
3,191 Points

Hi Jennifer, that makes a lot of sense, I can see where I want wrong now.

Many thanks

best

John