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 trialAleksander Z. Cehajic
3,111 PointsBummer?
when I preview code everything looks good, stil I can not get further to the next step. :(
<?php
$names = array('Mike', 'Chris', 'Jane', 'Bob');
foreach($names as $name){
echo "<li>" . $name . "</li>";
}
?>
4 Answers
Mayur Pande
Courses Plus Student 11,711 PointsHi I got this to work;
$names = array('Mike', 'Chris', 'Jane', 'Bob');
foreach ($names as $name){
echo "$name <br />";
}
?>
This works as it echos one name, and then skips to the new line. Hope this helps.
Aleksander Z. Cehajic
3,111 Pointsthx . Yes, you are right. When I removed list structure it worked. thx a again.
Jacob Mishkin
23,118 Pointson thing to remember when doing the challenges is that they are very rigid. The second part of the challenge just wants you to echo the array, so all you have to do is echo the $names variable, when you add more to the challenge they sometimes mark it wrong.
Aleksander Z. Cehajic
3,111 Points:) thx. I'll try to keep it simple next time. ;)