0
我想如下排序多维数组键
<?php
$country = array(
array(
'country' => 'India',
'visits' => 22,
'newVisits' => 16,
'newVisitsPercent' => 72.7),
array(
'country' => 'USA',
'visits' => 30,
'newVisits' => 15,
'newVisitsPercent' => 50),
array(
'country' => 'Japan',
'visits' => 25,
'newVisits' => 15,
'newVisitsPercent' => 60));
?>
排序多维数组基于特定键值的数组,我想排序数组中的降序的“访问”的顺序数组的键。
所需的阵列是
<?php
$country = array(
array(
'country' => 'USA',
'visits' => 30,
'newVisits' => 15,
'newVisitsPercent' => 50),
array(
'country' => 'Japan',
'visits' => 25,
'newVisits' => 15,
'newVisitsPercent' => 60),
array(
'country' => 'India',
'visits' => 22,
'newVisits' => 16,
'newVisitsPercent' => 72.7));
?>
试图在所有SO结果基于所述键的值排序进行搜索。请让我知道我们需要使用哪个功能。
我看着到ksort,多排序功能
['usort()'](http://php.net/usort)看看相关的列 – 2012-07-18 12:49:32
'usort'或'array_multisort' – Lake 2012-07-18 12:50:19
通过这个问题看起来像几分钟前:)完全相同,但从用户比以前少配置文件点,我不想猜测或判断,但看起来像有多个帐户的人 – haynar 2012-07-18 12:55:06