From e0a940d47a7aceed7dba7fca563bc60b40152472 Mon Sep 17 00:00:00 2001 From: btn15001 Date: Mon, 27 Feb 2017 14:15:07 -0500 Subject: [PATCH] some tests --- index.php | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) 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 . '
'; - } + ?>