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 trialBrian Johnson
Front End Web Development Techdegree Graduate 20,818 PointsPlease tell me what I’m doing wrong?
I’ve been working on this for a minute
<?php
//Place your code below this comment
$firstName ="Rasmus";
$lastName = "Lerdorf";
$fullName = $firstName + $lastName;
echo "$fullName was the original creator of PHP.\n";
?>
3 Answers
jamesjones21
9,260 PointsThe plus operator in PHP means add and doesn't concatenate, you will need to use the full stop as the concatenate operator. Then as suggested above you'll need to add a space using ' ' an then another full stop after it.
In js the plus sign is used to concatenate :)
Dave StSomeWhere
19,870 PointsFirst, have you tried running your code locally or in a workspace or even something like http://phpfiddle.org/.
I'm not sure of the exact expected output from the challenge but the first thing I would double check is your concatenation operator.
Brian Johnson
Front End Web Development Techdegree Graduate 20,818 Pointsok thanks I will try that
KRIS NIKOLAISEN
54,972 PointsNot sure why the second task is accepted but there is a space between first name and last name
$fullName = $firstName . ' '. $lastName;
Brian Johnson
Front End Web Development Techdegree Graduate 20,818 PointsBrian Johnson
Front End Web Development Techdegree Graduate 20,818 PointsThank You I figured it out! =D
jamesjones21
9,260 Pointsjamesjones21
9,260 Pointsit does cause confusion when going from one language to the next, but in php unless you are not working with numbers then use the full stop :) Plus for maths lol