title: Set array keys to value of another arrays values - PHP
body: <p>I have the following:</p>
  
  <p>( [0] => 3 [1] => 2 [2] => 12 [3] => 6 [4] => 8 [5] => 7 [6] => 9 [7] => 10 [8] => 5 [9] => 4 ) </p>
  
  <p>I want to use the value of each of those as the key in:</p>
  
  <p>( [0] => 7 [1] => 2 [2] => 10 [3] => 3 [4] => 5 [5] => 6 [6] => 11 [7] => 9 [8] => 4 [9] => 8 ) </p>
  
  <p>I've tried this:</p>
  
  <pre><code>foreach ($iOrder as $i)
  {
      $pOrder[$i] = $pOrder[$p];
  
      $p++;
  }
  </code></pre>
  
  <p>I get this:</p>
  
  <p>( [12] => 2 [10] => 6 [5] => 5 [4] => 7 ) </p>
  
  <p>Any thoughts?  </p>