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

Joshua Gressman
Joshua Gressman
4,695 Points

Why isn't this passing? <?php //Place your code below this comment $firstName = 'Rasmus'; $lastName = 'Lerdorf';

<?php

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

echo $ullname . " " . 'Rasmus Lerdorf was the original creator of PHP'"\n";

?>

index.php
<?php

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

echo $ullname . " " . 'Rasmus Lerdorf was the original creator of PHP'"\n";

?>

1 Answer

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

Hi, Joshua! There are a couple of reasons why this isn't passing.

  • You've misspelled the name of the variable to be echoed as ullname instead of fullname
  • You're repeating Rasmus Lerdorf in the string, but that is located in the variable fullname
  • It's not absolutely necessary to use concatenation here. If you use double quote around the entire string to be echoed it will expand the variable to reveal the value.
  • If you do use concatenation, you will have to rework the newline character that you've included in its own separate string.

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