【发布时间】:2011-06-06 05:57:37
【问题描述】:
我有两个这样的 PHP 数组:
- 包含 ID 的 X 记录数组 的 Wordpress 帖子(在特定的 顺序)
- Wordpress 帖子数组
这两个数组看起来像这样:
数组一(Wordpress 帖子 ID 的排序自定义数组)
Array (
[0] => 54
[1] => 10
[2] => 4
)
数组二(Wordpress 帖子数组)
Array (
[0] => stdClass Object
(
[ID] => 4
[post_author] => 1
)
[1] => stdClass Object
(
[ID] => 54
[post_author] => 1
)
[2] => stdClass Object
(
[ID] => 10
[post_author] => 1
)
)
我想按照第一个数组中 ID 的顺序对 wordpress 帖子数组进行排序。
我希望这是有道理的,并在此先感谢您的帮助。
汤姆
编辑:服务器运行 PHP 版本 5.2.14
【问题讨论】: