我怎样才能按顺序排列以下数组type
,url
然后doc
?page
$array = array(
0 => array(
'id' => '14',
'position' => '0',
'type' => 'related-url'
),
1 => array(
'id' => '2367',
'position' => '0',
'type' => 'related-doc'
),
2 => array(
'id' => '99',
'position' => '0',
'type' => 'related-page'
),
4 => array(
'id' => '180',
'position' => '2',
'type' => 'related-doc'
),
5 => array(
'id' => '10',
'position' => '3',
'type' => 'related-doc'
)
);
结果将是
$array = array(
0 => array(
'id' => '14',
'position' => '0',
'type' => 'related-url'
),
1 => array(
'id' => '2367',
'position' => '0',
'type' => 'related-doc'
),
4 => array(
'id' => '180',
'position' => '2',
'type' => 'related-doc'
),
5 => array(
'id' => '10',
'position' => '3',
'type' => 'related-doc'
),
2 => array(
'id' => '99',
'position' => '0',
'type' => 'related-page'
)
);
保持键关联并不重要。