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
9,432 Points

Why do you have the variable inside ""?

2 Answers

Steven Parker
Steven Parker
186,309 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
186,309 Points

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