fork(1) download
  1. <?php
  2.  
  3. $values = array("fourth", "first", "second", "third"); $indices = array(3, 0, 1, 2);
  4.  
  5. array_multisort($indices, $values);
  6.  
  7. var_dump($values);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(4) {
  [0]=>
  string(5) "first"
  [1]=>
  string(6) "second"
  [2]=>
  string(5) "third"
  [3]=>
  string(6) "fourth"
}