PHP PHP Basics Daily Exercise Program String Manipulation

Nkosinolwazi Moyo
Nkosinolwazi Moyo
9,578 Points

Combining variables

What's wrong with my code. If i submit,it says this "It looks like you forgot to add a space between the first and last name".

index.php
<?php
$firstName="Rasmus";
$lastName="Lerdorf";  
$fullName=  $firstName    .    $lastName;
//Place your code below this comment

?>

2 Answers

<noob />
<noob />
16,609 Points

in PHP u need to use “” around to combine variables. for example : $fullName = “$firstName $lastName”

you can also use the . operator which function like +: $fullName= $firstName . " " . $lastName

<noob />
<noob />
16,609 Points

check the updated answer