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 trialGö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.
<?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
5,965 PointsRemove 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";
Dhavidy Luiz Mamede Pires
12,438 PointsMust 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
1,304 PointsRemoving the "space" between PHP and \n worked for me.
Gökhan Yesilyayla
1,304 PointsGökhan Yesilyayla
1,304 PointsThat worked for me but i guess that is still a bug. Thank you though.