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

String Manipulation

What it's wrong with this code ? I get this error "You have not used the correct spacing in your string"

<?php

//Place your code below this comment

$firstName = 'Rasmus';
$lastName = 'Lerdorf';
$fullName = $firstName . ' ' . $lastName;

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

?>

4 Answers

Robert Leonardi
Robert Leonardi
17,151 Points

There's nothing wrong with your code. The string's fine.

Rasmus Lerdorf was the original creator of PHP

But why I get error ?

Robert Leonardi
Robert Leonardi
17,151 Points

You can try debugging few ways

  1. try deconstructing your code one by one.. for example , only echo firstname, ... then only lastname, then... try echo both.. or combine with other string, etc.
  2. make sure you have no other code beside these lines..

good luck

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

Actually just missing the period, but I also change the challenge to give a better hint :)

Finally I was pass the challenge, thank u!

Robert Leonardi
Robert Leonardi
17,151 Points

@unnamed1056 , pls upvote my answer if you find them helpful