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!

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 trial

PHP PHP Basics Daily Exercise Program String Manipulation

Alan Jeronimo
Alan Jeronimo
1,220 Points

I Can't see what I'm doing wrong here! Someone give me a hand please ?

I Can't see what I'm doing wrong here! Someone give me a hand please ?

index.php
<?php

//Place your code below this comment

$firstName = 'Rasmus';
$lastName = 'Lerdorf';

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

echo "$fullName";


?>

2 Answers

nico dev
nico dev
20,364 Points

Hi Alan Jeronimo ,

I guess you're in step 2 of the challenge, right?

If so, you're not doing bad at all. Still you're not being requested to echo nothing out yet. And you're using double quotation marks, which makes it possible to concatenate the values of $lastName in an even more succinct and efficient way. If you can check it now, if it still feels strange, check next paragraph.

You can concatenate them like this (as long as you use double quotation marks):

<?php

$firstName = 'Rasmus';
$lastName = 'Lerdorf';

$fullName = "$firstName $lastName";
Alan Jeronimo
Alan Jeronimo
1,220 Points

Thank you very much my friend, it worked!!

Yes it had not required (echo) yet but I was using it bc it was saying I was doing it wrong and I was trying to figure it out.

One more time, Thank you!