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

Use the $fullname variable to display the following string to the screen. Use an escape character to add a newline to th

Use the $fullname variable to display the following string to the screen. Use an escape character to add a newline to the end of the string. 'Rasmus Lerdorf was the original creator of PHP'

this was my answer

<?php

//Place your code below this comment

$firstName = "Rasmus"; $lastName = "Lerdorf";

$fullname = $firstName . ' ' . $lastName;

echo "$fullname was the orginal creator of PHP\n";

?>

What's wrong with this?

index.php
<?php

//Place your code below this comment

$firstName = "Rasmus";
$lastName = "Lerdorf";

$fullname = $firstName . ' ' . $lastName;

echo "$fullname was the orginal creator of PHP";

?>

3 Answers

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

Hi there! You currently have two things incorrect which are preventing you from passing the last step of the challenge. But because you're so close here, I'm just going give some hints.

  • You are missing a new line character in your echo statement as specified by the challenge instructions
  • You've misspelled the word "original"

Give it another shot with these hints in mind! :sparkles:

Hi Jennifer,

I got it now :) Thanks for the support :)

Regards,

SN

rob111
rob111
8,379 Points

Here's my version but it's not letting me pass

<?php

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

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

?>

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

Hi, Rob Nanya! No, your code is not correct, but in the interest of keeping the questions sorted and posted appropriately so they are searchable by other Treehouse students, I'd suggest that you post an entirely new question in the forums.

But I will give you a hint: your strings need to be inside quotation marks.

Good luck! :sparkles: