2
沒有什麼太多的解釋,我會直接到達樣本代碼:PHP排序多維數組的漁政船
<?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;
?>
可以」真的讓我的頭在附近。簡而言之:我不想排序整個數組,但我想對數組的特定維數進行排序