title: Array losing a key on the way
body: <p>Hello i have a piece of code with an example of array and the problem is that i'm loosing a key of the array. The array is a multidimensional one and i have posted here an sample version because i have a lot of keys in it ( too long to post it ) </p>
  
  <pre><code>$columns = array(
      "1" =&gt; array(
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
  );
  $array = array(
      "1" =&gt; array(
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
  ),
      "2" =&gt; array(
      "1" =&gt; "bar",
      "2" =&gt; "foo",
      "3" =&gt; "bar",
      "4" =&gt; "foo",
      "5" =&gt; "bar",
      "6" =&gt; "foo",
      "7" =&gt; "bar",
      "8" =&gt; "foo",
      "9" =&gt; "bar",
      "10" =&gt; "foo",
  )
  );
  </code></pre>
  
  <p>ok in this two arrays i have a fixed number or keys and what i want to achieve is getting the values from the first array and use them as keys in my second array. So far so good but when i do the second foreach to get the values from first and put them as keys in the second on the way i'm loosing on of my keys from $array ( i think it rewritten ). can you help me out with this code because i have no ideea how to fix it.</p>
  
  <pre><code>foreach($array as $key =&gt; $val)
  {
      array_splice($val, 66);
      foreach($val as $k =&gt; $row) 
      {
          if ( isset($columns[$k])) 
          {
              $info[$columns[$k]] = $row;
          }
      }
      return $info;
  }
  </code></pre>
  
  <p>Update:</p>
  
  <p>What i wanted to achieve here was creating an array using an array for keys and another one for values. Later on discovered that i can do it with array_combine. Solved my problem</p>