Loop through the provided ingredients and compare them to the recipes actual ingredients.
Possible solutions:
PHP Code:
temp.matches = countIngredients(recipe);
temp.match = 0;
for (ingredient: ingredients) {
if (ingredientInRecipe(recipe, item, qty)) temp.match++;
}
if (temp.match == temp.matches) {
return recipe;
}
then in your.. ingredientInRecipe(recipe, item, qty) you can specify if it needs to be exact or what not.