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

Karim shlal
Karim shlal
1,652 Points

Display: Rasmus Lerdorf was the original creator of PHP. 3) Use character to add a newline to the end of the string.

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

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

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! While your output would be what is expected it does so by changing the value of $fullName. What if I added this to the instructions? Echo out the full name plus "was the original creator of PHP" and a new line without changing the value of $fullName from what it was at the end of Step 2.

:hint: The easiest way to accomplish this is to echo the string using double quotes to expand the value of the $fullName variable. Doing it this way means that no concatenation is required.

Hope this helps! :sparkles: