次の配列を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'
)
);
キーの関連付けを維持することは重要ではありません。