I have been searching this but did not find any solution anywhere. I want to re order my array with a specific index.
Like this:
$scoreboard = array(
'foo' => array(
'score' => 580,
'game' => 'google',
),
'bar' => array(
'score' => 1385,
'game' => 'facebook',
),
'car' => array(
'score' => 750,
'game' => 'tweet',
),
);
And the output should be like this:
$scoreboard = array(
'bar' => array(
'score' => 1385,
'game' => 'facebook',
),
'car' => array(
'score' => 750,
'game' => 'tweet',
),
'foo' => array(
'score' => 580,
'game' => 'google',
),
);
See that the array is rearranged with each item's 'score' index. Any help here?