【发布时间】:2014-09-24 05:35:48
【问题描述】:
我有一个这样的数组值。我试过array_search,它没有用。 我想要的是仅过滤具有状态值的数组值。
输出
Array
(
[1] => Array
(
[author] => Author1
[book] => Book1
[status] => 1
)
[2] => Array
(
[author] => Author2
[book] => Book2
)
[3] => Array
(
[author] => Author3
[book] => Book3
[status] => 1
)
)
预期输出
Array
(
[1] => Array
(
[author] => Author1
[book] => Book1
[status] => 1
)
[3] => Array
(
[author] => Author3
[book] => Book3
[status] => 1
)
)
如果预期的输出具有正确的数字序列,我会更高兴。在上述情况下,有两个数组,数组编号为 [1] 和 [3] 。如果可能,我需要将其设为 [1] 和 [2]。
任何帮助都会非常有用。
谢谢, 金兹
【问题讨论】:
标签: php arrays sorting arraylist multidimensional-array