没什么好解释的,我直接上示例代码:
<?php
$array[0]['a'] = 3;
$array[0]['b'] = 2;
$array[0]['c'] = 4;
$array[0]['d'] = 1;
$array[1]['a'] = 4;
$array[1]['b'] = 2;
$array[1]['c'] = 3;
$array[1]['d'] = 1;
$array[2]['a'] = 1;
$array[2]['b'] = 2;
$array[2]['c'] = 4;
$array[2]['d'] = 3;
?>
排序后,它应该是这样的:
<?php
$array[0]['d'] = 1;
$array[0]['b'] = 2;
$array[0]['a'] = 3;
$array[0]['c'] = 4;
$array[1]['d'] = 1;
$array[1]['b'] = 2;
$array[1]['c'] = 3;
$array[1]['a'] = 4;
$array[2]['a'] = 1;
$array[2]['b'] = 2;
$array[2]['d'] = 3;
$array[2]['c'] = 4;
?>
我真的无法理解它。简而言之:我不想对整个数组进行排序,而是对数组的特定维度进行排序