この配列が与えられた場合:
Array
(
[0] => Array
(
[title] => this is the newest post
[ssm_featured_post_id] => 70
)
[1] => Array
(
[title] => sdfsfsdf
[ssm_featured_post_id] => 63
)
[2] => Array
(
[title] => test
[ssm_featured_post_id] => 49
)
[3] => Array
(
[title] => Hello world!
[ssm_featured_post_id] => 1
)
)。
ssm_featured_post_id値は、2番目の配列の配列項目の値に対応します。最初の配列アイテムを2番目の配列のアイテムと同じ順序で並べたい
Array
(
[1] => 63
[0] => 70
[3] => 1
[2] => 49
)
したがって、並べ替え後の結果は次のようになります。
Array
(
[0] => Array
(
[title] => sdfsfsdf
[ssm_featured_post_id] => 63
)
[1] => Array
(
[title] => this is the newest post
[ssm_featured_post_id] => 70
)
[2] => Array
(
[title] => Hello world!
[ssm_featured_post_id] => 1
)
[3] => Array
(
[title] => test
[ssm_featured_post_id] => 49
)
)