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

Clarity on Challenge Task 3 of 3 PHP Basics 2

$firstName = "Rasmus"; $lastName = "Lerdorf"; $fullname = "$firstName" . ' ' . "$lastName";

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

echo = $string_one;

I don't know what I'm missing. Unless they are looking for the "'" in the string, to which I then wrote:

$firstName = "Rasmus"; $lastName = "Lerdorf"; $fullname = "$firstName" . ' ' . "$lastName";

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

echo $string_one;

which also fails. (I submitted them separately... added them together for the post.) I get the requested result... I think.

index.php
<?php

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

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

echo = $string_one;

?>

<?php
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullname = "$firstName" . ' ' . "$lastName";
$fullname .= " was the original creator of PHP";
$fullname .= "\n";
echo $fullname;
?>

2 Answers

Algirdas Lalys
Algirdas Lalys
9,389 Points

Hi Travis Morgan,

Well it seems you are going the right way. First three lines are great just needed to echo it.

<?php

//Place your code below this comment
$firstName = "Rasmus";
$lastName = "Lerdorf";
$fullname = $firstName . " " . $lastName;
echo $fullname . " was the original creator of PHP\n";
?>

Thank you @Algirdas Lalys. Yep, worked perfectly.