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 PHP Loops Challenge

geoffrey
geoffrey
28,736 Points

foreach exercise php basics, problem?

Hey everyone, I wanted to review some PHP by watching quickly the PHP basics course and I now run into troubles.

I can't pass the exercise, I don't understand why... Have I misunderstood something ? Is it due to an error I would have done ? No idea... My code runs correctly when I test it directly into the workspace.

Here is what I typed :

<?php 
$names = array('Mike', 'Chris', 'Jane', 'Bob');

foreach($names as $name){
  echo $name;
}

?>

It says Bummer ! I don't not see a foreach statement, or something like that. If someone could test to tell me If that works.

Thank you.

Ken Alger
Ken Alger
Treehouse Teacher

Geoffrey;

Your code looks good. Others, including myself, seem to be having issue with this particular code challenge parser.

Ken

2 Answers

Hi geoffrey,

It's not your code that is the problem.

Jeff

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

I get the same error, but running good via Sublime Text 2 is good.

This has to be something with the the site I guess...