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 trialTrần Phúc
2,264 PointsISSUES ERROR IN recipecollection.php
MY CODE
<?php...
public function getCombinedIngredients()
{
$ingredients = array();
foreach ($this->recipes as $recipe) {
foreach ($recipe->getIngredients() as $i) {
$item = $i['item'];
if (strpos($item, ",")) {
$item = strstr($item, ",", true);
}
if (in_array($item . "s", $ingredient_list)) {
$item .= "s";
} else if (in_array(substr($ingredient,0,-1),$ingredient_list)) {
$ingredient = substr($ingredient,0,-1);
}
$ingredient_list[$item][] = array($i["amount"],$i["measure"]);
}
}
return $ingredients;
}
?>//LINE 63
MY ERROR
Parse error: syntax error, unexpected '?>', expecting function (T_FUNCTION) in /home/treehouse/workspace/classes/recipecollection.php on line 63