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

Bára Paulátová
Bára Paulátová
3,583 Points

Help - the quiz won't let me finish. Keeps repeating the Task no 1 is no longer passing, even if I start all over again.

Is it because my code is wrong? I checked twice with the previous video and it seems ok. Could it be a bug in the system?

Thanks for your help. b.

index.php
<?php

//Place your code below this comment

$firstName = 'Rasmus';
$lastName = 'Lerdorf';

$fullName = $firstName . ' ' . $lastName;

$string_one = $fullName
$string_one .= ' was the original creator of PHP.';
$string_one .= "\n";

echo $string_one;

?>

2 Answers

I think your code is fine, it works. Maybe they just want you to do it this way, not building the string one by one.

$string_one  = "{$fullName} was the original creator of PHP.\n";
Bára Paulátová
Bára Paulátová
3,583 Points

Samuel, thanks for you answer .. it worked ! .. still do not know why, since I understood that it is both the same and even when viewing the output it looked the same. Still thanks thou! You helped me complete the challenge :)

Yeah, I think that is one of coding challenge flaw. Can't blame them though, since there are many ways to solve a problem so it's kinda hard to check for all solutions. But since the string we want to echo is just a simple one-line text, I think this solution is enough to solve it.