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 PHP Basics (Retired) PHP Conditionals & Loops Conditionals Challenge

Echo the following Sentence in If Statement 'Hi, I am Mike!' Echo doesn't pass.

Hello!

I need help again :) If anyone can offer advice I'd appreciated it. The following code isn't passing - <?php $name = "Mike";

if($name == "Mike"){ $info='Hi, I am Mike!'; } ?> I'm curious if I'm missing something because the Error states "Make sure you use the exact wording from the the sentence above". An earlier error I saw in Forums showed the user typed a small L.. I did not, I typed a "I" as it shows in the sentence.

What else is wrong with this last question?

Thanks! Sherry

Did you try double-quotes at the point you assign "Hi, I am Mike!" to $info?

2 Answers

Jaroslav Vankat
Jaroslav Vankat
12,054 Points

Hi,

in the challange you are not supposed to initialize variable $info with the sentence "Hi, I am Mike!" but you shall echo it. So just use:

echo "Hi, I am Mike!";

Hi! Thanks to both.. I tried another:

$info = 'Hi, I am Mike!'; echo $info;

That passed.. Jeez can't wait til understand this like it's plain English :)

Thank you so much!!

Sherry