我有以下数组:
$myarray = Array (
[1] => stdClass Object (
[ID] => 1
[current] =>
)
[2] => stdClass Object (
[ID] => 2
[current] => 1
)
[3] => stdClass Object (
[ID] => 3
[current] =>
)
[4] => stdClass Object (
[ID] => 4
[current] =>
)
[5] => stdClass Object (
[ID] => 5
[current] =>
)
)
而且我需要对它进行排序,将值current作为第一个,然后是最初在当前项目之后的所有项目,而最初之前的项目将是结果数组中的最后一个项目。
所以新数组看起来像这样:
Array (
[1] => stdClass Object (
[ID] => 2
[current] => 1
)
[2] => stdClass Object (
[ID] => 3
[current] =>
)
[3] => stdClass Object (
[ID] => 4
[current] =>
)
[4] => stdClass Object (
[ID] => 5
[current] =>
)
[5] => stdClass Object (
[ID] => 1
[current] =>
)
)
非常重要的是