【发布时间】:2011-11-23 11:24:30
【问题描述】:
可能重复:
Is there a PHP function to remove any/all key/value pairs that have a certain value from an array?
Remove zero values from a PHP array
我有一个这样的数组。
[notify_emp] => Array
(
[224] => 0
[228] => 0
[232] => 1
[250] => 1
[350] => 1
)
我只想要数组中值设置为 1 并且需要删除值为 0 的键的那些键。 如何在 php 中使用 create_function 执行此操作?还是有其他方法可以执行该操作?
【问题讨论】:
-
我不明白你为什么要在这里使用
create_function。
标签: php create-function