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! While you're at it, check out some resources Treehouse students have shared here.

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 Build a Simple PHP Application Adding a Contact Form Concatentation

sebastian rojas
sebastian rojas
571 Points

Stage 3 "Adding a Contact Form" Challenge

Hey guys! I am stuck on task 4 and my code atm looks like this

<?php

$firstName = "Mike"; $middleName = "the"; $lastName = "Frog"; $fullName = "$firstName $middleName $lastName";

echo "The designer at Shirts 4 Mike shirts is named $fullName ";

?>

i am asked to "Use concatenation to add an exclamation point to the echo command after the fullName variable" and i dont understand the question so would be nice with some help over here ! :)

sebastian rojas
sebastian rojas
571 Points

I finally got it! So no need for help now! :D

You beat me! Nice work.

1 Answer

From the looks of it, it looks like you don't understand what quotes are for and what they are not for.

If you want your variables to work like you believe they should (You are believing correctly hahah :) ), do not quote them.

Quote and echo your strings, echo your variables unquoted.

Like this: (Notice the proper use of quoted empty space, for spaces)

<?php
$name = "Leonardo";

$lastname = "H";

$fullname = $name . " " . $lastname; 

echo "Hi my name is " . $fullname;
?>