给定这个数组:
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 值对应于第二个数组中数组项的值。我想以与第二个数组中的项目相同的顺序对第一个数组项进行排序
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
)
)