PHP PHP Basics Daily Exercise Program String Manipulation

Meeting Hub
Meeting Hub
1,672 Points

$fullName should equal Rasmus Lerdorf

equal

index.php
<?php
//Place your code below this comment

$firstName = "Rasmus";
$lastName = "Lerdorf";

$fullName = "Hello $firstName  $lastName";

echo $fullname;
?>

2 Answers

Steven Parker
Steven Parker
200,416 Points

Try leaving out the "Hello " and use only one space between the names.

And you don't need to "echo" anything until task 3 (and then you'll construct a whole sentence).

Nathon Reed
PRO
Nathon Reed
Pro Student 4,515 Points

Try to concatenate your string.

$fullName = "Hello " . $firstName . " " . $lastName;

If you need me explain how this works please let me know. Thank You.

Steven Parker
Steven Parker
200,416 Points

Concatenation is another approach (and would also work), but you'd still need to leave off the "Hello "! :see_no_evil: