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 Echo Variables

I'm having trouble with PHP Basics variables- echo. I have tried it in one code block and two code blocks and it won't let it pass. Can anyone please help?

<?php $name = "Mike"; echo $name; ?>

5 Answers

Yeah, something's weird. Not working for me in 2 different browsers, even when c+p-ing in the above answer that worked for some.

Edited to add: -bizarre; it worked like the 10th time using the same code I used all along after I refreshed the browser, restarting the code challenge.

I pasted your code in and it worked just fine.

Why doesn't it work for me?

Is your file saved with a .php extension?

It is in index.php, so yes I think so.

It works

Are you running your code in a server like xamp/wamp?

Thanks Gerardo; I just had too many programs running for Chrome's liking. Once I shut down Facebook and Pandora it worked.