diff --git a/index.php b/index.php index b26ae3a..11903dd 100644 --- a/index.php +++ b/index.php @@ -9,22 +9,13 @@ ini_set('display_errors', 1);
'with',
- 'tomato' => 'without',
- 'onions' => 'with');
+ $food = array('wake_up_wrap');
+ $wake_up_wrap = array('Gluten' => 'Contains',
+ 'Eggs' => 'Contains',
+ 'Dairy' => 'Contains',
+ 'Soy' => 'Contains');
- $pizza = array('cheese' => 'with',
- 'pepperoni' => 'without',
- 'mushrooms' => 'with');
-
- $burger = array('cheese' => 'without',
- 'bread' => 'without',
- 'bacon' => 'with',
- 'onions' => 'without',
- 'lettuce' => 'with',
- 'mayo' => 'with',
- 'pickles' => 'with');
+
// Looping through an array using "for".
// First, let's get the length of the array!
@@ -35,27 +26,15 @@ ini_set('display_errors', 1);
echo $food[$i] . '
';
}
- echo '
I want my salad:
';
+ echo '
This item:
';
// Loop through an associative array using "foreach":
- foreach ($salad as $ingredient=>$include) {
+ foreach ($wake_up_wrap as $ingredient=>$include) {
echo $include . ' ' . $ingredient . '
';
}
- // Create your own array here and loop
- // through it using foreach!
- echo '
I want my pizza:
';
-
- foreach ($pizza as $ingredient=>$include) {
- echo $include . ' ' . $ingredient . '
';
- }
-
- echo '
I want my burger:
';
-
- foreach ($burger as $ingredient=>$include) {
- echo $include . ' ' . $ingredient . '
';
- }
+
?>