Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
some tests
  • Loading branch information
btn15001 committed Feb 27, 2017
1 parent 361de8c commit e0a940d
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions index.php
Expand Up @@ -9,22 +9,13 @@ ini_set('display_errors', 1);
<body>
<p>
<?php
$food = array('pizza', 'salad', 'burger');
$salad = array('lettuce' => '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!
Expand All @@ -35,27 +26,15 @@ ini_set('display_errors', 1);
echo $food[$i] . '<br />';
}

echo '<br /><br />I want my salad:<br />';
echo '<br /><br />This item:<br />';

// Loop through an associative array using "foreach":
foreach ($salad as $ingredient=>$include) {
foreach ($wake_up_wrap as $ingredient=>$include) {
echo $include . ' ' . $ingredient . '<br />';
}


// Create your own array here and loop
// through it using foreach!
echo '<br /><br />I want my pizza:<br />';

foreach ($pizza as $ingredient=>$include) {
echo $include . ' ' . $ingredient . '<br />';
}

echo '<br /><br />I want my burger:<br />';

foreach ($burger as $ingredient=>$include) {
echo $include . ' ' . $ingredient . '<br />';
}


?>
</p>
Expand Down

0 comments on commit e0a940d

Please sign in to comment.