title: Combining array_keys and array_values to original array?
body: <p>I have a method that inserts data into a table using an associative array that looks like this:</p>
  
  <pre><code>array(
      "col1" =&gt; "value1",
      "col2" =&gt; "value2",
      "col3" =&gt; "value3",
  );
  </code></pre>
  
  <p>If I use <code>array_keys()</code> and <code>array_values()</code> on the array passed in can I guarantee that the first item in each set, match the original array passed in?</p>
  
  <pre><code>// Note: validation excluded
  $keys   = array_keys($data);   // $data is the array passed in
  $values = array_values($data);
  $q      = array_pad(array(), count($data), "?");
  
  $this-&gt;query("insert into `$this-&gt;table` (`" . implode("`,`", $keys) . "`) values (" . implode(",", $q) . ")", $values);
  </code></pre>
  
  <p>So, with that, can I guarantee that <code>$keys[1]</code> and <code>$values[1]</code> are the same key and value from the original array, or is it possible that they could be <code>col3</code> and <code>value1</code>?</p>
  
  <p>Another way to say it, if i use <code>array_combine($keys, $values)</code> will I get the original array <code>key =&gt; value</code> pair back (item order excluded)?</p>
  
  <p>I am worried that if this doesn't do what I am thinking that <code>value2</code> may go into <code>col3</code> instead of <code>col2</code> or something like that....</p>