I'm looking for a way to filter array so all elements with key is specified are removed.
Here's an example of what I mean:
$x = array(
'a', // pass
'b::a', // pass
array('a'), // pass
array('a', 'b'), // pass
function() { // pass
return 'a';
},
'a' => 'b', // doesn't pass because key is specified
);
After remove_elements_with_key_specified($x)
...
array(5) {
[0]=> string(1) "a"
[1]=> string(4) "b::a"
[2]=> array(1) { [0]=> string(1) "a" }
[3]=> array(2) { [0]=> string(1) "a" [1]=> string(1) "b" }
[4]=> object(Closure)#1 (0) { }
}
How to do it? Would simple check that key is a string would be the best way?