tags:

views:

33

answers:

2

I have an array, like below. The fact is that $array[0][0] and $array[1][0] are connected. And should stay together.

But I would like to order on the $array[1] values.

$array[0][0] = '567';
$array[0][1] = '3971';
$array[0][2]  = '19';
$array[0][3] = '1';

$array[1][0]  = '10';
$array[1][1] = '50';
$array[1][2]  = '80';
$array[1][3] = '30';

So $array[1][2] = '80'; is the highest and should go to the top, but $array[0][2] = '19'; should move along in his own array.

How do I accomplish this?

+3  A: 

Use array_multisort.

array_multisort($array[0], $array[1]);
bdonlan
A: 

would I use array_multisort($ar1, $ar2);?

yes now wouldnt i? hmm am i that stupid

rene van der Kooi
Is this sarcastic or self-critical? I can't tell.
deceze
Not sure what you mean, but this may be better as an edit to your original question
R0MANARMY