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

Ben Koconis
Ben Koconis
2,737 Points

Challenge Task 3 of 3: using $fullname and newline problem; not sure what im doing wrong on last part.

Does anyone see a problem in my code? Thanks much.

index.php
<?php

//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullname =  "$firstName $lastName";
$fullname =  ' . $firstName $lastName . ' ."\n";
echo $fullname
?>

2 Answers

Hi Ben,

One problem is that you're changing the $fullname variable to be something else. Once you've set it to the first and last name, you don't want to reassign something else to it.

You could echo out the final string directly or choose another variable name.

The other problem is that you're not echoing the full string that the challenge wants.

It's looking for 'Rasmus Lerdorf was the original creator of PHP' and you should use the $fullname variable to create that. Not the first and last name variables.

Ben Koconis
Ben Koconis
2,737 Points

Thanks much, Jason.