Hi,
I've got an array, indexed by keys, eg:
array(
'key1' => 'value1',
'key2' => 'value2',
...
'key57' => 'value57'
)
How to "filter" that array, in order to only have, for example:
array(
'key2' => 'value2',
'key57' => 'value57'
)
and preserve keys.
I know array_filter() function, but I do NOT want to EXCLUDE all items except 2 and 57, no I just want to KEEP these values.
Is there exist a PHP core function we could name array_keep() or something ?
Thanks.