Forum Moderators: coopster
$array1 = array(1, 2, 3, 4, 5);
$array2 = array(a, b, c, d, e);
[code acts on $array1 so that it becomes]:
$array1 = array(3, 1, 5, 4, 2);
I need code that gives this result:
$array2(c, a, e, d, b);
This is probably pretty simple using the keys for each, but I'm not skilled enough in php to do it.
maybe using something like this
$array3 = array_combine [php.net]($array1,$array2);
then you would just need to sort it
array_combine is PHP5 only, I think you could loop through them and do the same thing if need be.
You could try using something like array_multisort [php.net] as well