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 trialTHEOCHARIS LIVIERATOS
2,766 PointsThe question is to echo every flavor.I cant understand the Bummer i get. my answer is correct.
i cant figure out the mistak.
<?php
$flavors = array();
$flavors[] = array("name" => "Cookie Dough", "in_stock" => true);
$flavors[] = array("name" => "Vanilla", "in_stock" => false);
$flavors[] = array("name" => "Avocado Chocolate", "in_stock" => false);
$flavors[] = array("name" => "Bacon Me Crazy", "in_stock" => true);
$flavors[] = array("name" => "Strawberry", "in_stock" => false);
//add your code below this line
#for($i=0;$i<5;$i++) {
foreach ($flavors as $key => $value) {
echo $flavors[$key]["name"];
}
#}
?>
1 Answer
THEOCHARIS LIVIERATOS
2,766 Pointsactually not. it doesnt even compile. the aswer is $value['name']. anyway thx for your time