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 am coding this correctly, but it isnt processing the answer correctly.

as above

index.php
<?php

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

echo $fullName;
?>
Pontus Bolmér
Pontus Bolmér
12,471 Points

Why do you have the variable inside ""?

2 Answers

Steven Parker
Steven Parker
229,921 Points

Here's some hints:

  • as Pontus observed, you should never put a variable name in quotes
  • use a space between the two names (not a new line)
  • try combining the names (and space) in one statement using "." operators

Clearly i wasn't coding it correctly and had gone a bit loopy! Thanks people :)

Steven Parker
Steven Parker
229,921 Points

Glad I could help, and happy holidays! :christmas_tree: