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

Gökhan Yesilyayla
Gökhan Yesilyayla
1,304 Points

"You have not displayed the correct string"

I am not able to pass the 3rd part of the PHP exercise. "Bummer - You have not displayed the correct string"

I guess there is something wrong with the "newline" part "\n" but i don't see any mistake.

index.php
<?php

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

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

?>


//EDIT
// I have also tried with
<?php
echo $fullname." was the original creator of PHP"."<br>"."newline";
?>

//The word "newline" is displayed correct in the preview but i still get a bummer.

2 Answers

Matthew Carson
Matthew Carson
5,965 Points

Remove the space between the 'PHP' and the newline character in " was the original creator of PHP \n";

<?php
echo $fullname." was the original creator of PHP\n";
Gökhan Yesilyayla
Gökhan Yesilyayla
1,304 Points

That worked for me but i guess that is still a bug. Thank you though.

Dhavidy Luiz Mamede Pires
Dhavidy Luiz Mamede Pires
12,438 Points

Must be a bug! That's my code below, getting the same error.

<?php

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

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

// Also tried
// echo "'$fullname was the original creator of PHP' \n";

?>
Gökhan Yesilyayla
Gökhan Yesilyayla
1,304 Points

Removing the "space" between PHP and \n worked for me.