$hoge = $_SESSION[ranking]; $i = 0; foreach($hoge as $key => $row){ $id[$key] = $row["id"]; $counts[$key] = $row["counts"]; $i ++; } array_multisort($counts,SORT_DESC,$hoge); echo '<pre>'; var_dump($hoge); echo '</pre>';
$hoge = $_SESSION[ranking]; $i = 0; foreach($hoge as $key => $row){ $id[$key] = $row["id"]; $counts[$key] = $row["counts"]; $i ++; } array_multisort($counts,SORT_DESC,$hoge); echo '<pre>'; var_dump($hoge); echo '</pre>';