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

Stuck on PHP Question

I am taking a quiz and I have no idea what to do. Here is the question:

1) Use the $fullName variable

2) Display the following string to the screen.

Rasmus Lerdorf was the original creator of PHP.

3) Use an escape character to add a newline to the end of the string.

Here is my code:

<?php

//Place your code below this comment

$firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = $firstName . " " . $lastName "was the orignal creator of PHP";

?>

Would you mind helping me? Answers in code are best.

Thanks!

index.php
<?php

//Place your code below this comment

?>

What does jdd mean?

3 Answers

And don't forget item 3) of the question! ;)

I think it's much more useful to give you a hint, rather than giving you the code if you don't mind.

3 things I noticed: 1) they ask to display text. what could you use to display the $fullName variable? 2) in your code, to display the sentence, I miss a concatenator 3) you're combining two things in one line of code: creating the fullName variable and displaying the full sentence

I hope this is helpful. If not, let me know!

Cheers!

Ok, I got to here:

<?php

//Place your code below this comment $firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = $firstName . " " . $lastName . " " was the original creator of PHP./n";

?>

Unfortunately, I have a disability and it makes it really hard for me to get through this stuff. I don't know what's not working in the code. I'm wondering if I'm setting up the /n wrong or if it's something else in the way I wrote it.

Anyways, thanks for your help! :)