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

I cannot figure out what I am doing / why i am getting no output

unsure what i am doing wrong here to not be getting an output

index.php
<?php

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

$fullName = "$firstName $lastName";

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


?>

1 Answer

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

Hi there, jonny black! Remember that double quotes are used when you need the value of a variable as a part of the string. If you had tried to display the value of $string_one to the console right now, it would display:

  $fullName was the original creator or PHP

Literally, it would look just like that without a new line character, period, but most importantly, instead of "Rasmus Lerdorf" in place of $fullName it would say the variable name "$fullName" which isn't what we're after.

First, you will need double quotes so that it gives the value stored in $fullName instead of the string "$fullName". Secondly, you need to echo the string to display it. Finally, the string should end with a period/full stop and a new line character.

This is the line you're looking for:

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

Hope this helps! :sparkles: