Possible Duplicate:
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
I have one array like this.
[notify_emp] => Array
(
[224] => 0
[228] => 0
[232] => 1
[250] => 1
[350] => 1
)
I want only those keys from the array which have value set to 1 and need to remove keys that have value 0. how can I do this using create_function in php ? or is there any other way to perform the action?
Try this:
Which results in: