Cameron Leavitt3,651 Points
1) Use the $fullName variable 2) Display the following string to the screen. Rasmus Lerdorf was the original creator
This is what I used and I get the correct output but it gives me an error saying the fullName has to be Rasmus Lerdorf.
<?php //Place your code below this comment $firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = "$firstName " . "$lastName "; $fullName .= 'was the original creator of PHP.'; $fullName .= "\n"; echo $fullName; ?>
KRIS NIKOLAISEN54,164 Points
There is a note: Important: In each task of this code challenge, the code you write should be added to the code from the previous task.
Each step the checker will check all tasks. You have updated $fullName in task 3 so it no longer passes task 2. For task 3 you should be able to echo the string that includes the $fullName variable without updating $fullName.
Jonathan BarriosTreehouse Teacher
You are very close!
Using your code at Challenge Task 2 of 3, I get the following error:
Bummer: $fullName should equal Rasmus Lerdorf and this is because the
$fullName variable should only return
Rasmus Lerdorf. You code is using
$fullName to echo the WHOLE sentence and this is where the problem lies. I echo the WHOLE sentence using double quotes without using
$fullName .= and it passed:
<?php $firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = "$firstName $lastName"; // 👈 No concatenation symbol `.` needed with double quotes echo "$fullName was the original creator of PHP.\n";
Happy coding 🙌