title: Compare the data of two arrays using foreach PHP
body: <p>I'm currently trying to compare the data of two arrays against eachother. My code looks something like the one below:</p>
  
  <pre><code>foreach ($arrayOne as $one) {
      $variable = $one['one'];
      foreach ($arrayTwo as $two) {
          if ($two == $variable) { 
              echo "Match!";
          }
      }
  }
  </code></pre>
  
  <p>However, it only compares against the first element in <code>$arrayTwo</code>, it's not looping through everything <code>$arrayTwo</code>. Why is this? Furthermore, is there a MORE EFFICIENT way to accomplish what I'm trying to do?</p>
  
  <p>SNIPPET of Array One:</p>
  
  <pre><code>array (
    0 =&gt; 
    array (
      'paper_item_id' =&gt; 1,
      'type' =&gt; 1,
      'cost' =&gt; 20,
      'is_member' =&gt; false,
      'label' =&gt; 'Blue',
      'prompt' =&gt; 'Blue',
      'layer' =&gt; 1500,
    ),
    1 =&gt; 
    array (
      'paper_item_id' =&gt; 2,
      'type' =&gt; 1,
      'cost' =&gt; 20,
      'is_member' =&gt; false,
      'label' =&gt; 'Green',
      'prompt' =&gt; 'Green',
      'layer' =&gt; 1500,
    ),
    2 =&gt; 
    array (
      'paper_item_id' =&gt; 3,
      'type' =&gt; 1,
      'cost' =&gt; 20,
      'is_member' =&gt; false,
      'label' =&gt; 'Pink',
      'prompt' =&gt; 'Pink',
      'layer' =&gt; 1500,
    ),
    3 =&gt; 
    array (
      'paper_item_id' =&gt; 4,
      'type' =&gt; 1,
      'cost' =&gt; 20,
      'is_member' =&gt; false,
      'label' =&gt; 'Black',
      'prompt' =&gt; 'Black',
      'layer' =&gt; 1500,
    ),
  )
  </code></pre>
  
  <p>SNIPPET of Array Two:</p>
  
  <pre><code>array (
    0 =&gt; 'Blue',
    1 =&gt; '
  Purple Bat Wings',
    2 =&gt; '
  Black Motorbike',
    3 =&gt; '
  Test Scarf',
    4 =&gt; '
  Black',
    5 =&gt; '
  Green',
    6 =&gt; '
  Referee Jersey',
    7 =&gt; '
  Stethoscope',
    8 =&gt; '
  Custom Hoodie',
    9 =&gt; '
  ',
  )
  </code></pre>