Skip to content
Advertisement

Tag: associative-array

Return all array elements except for a given key

Simple one, I was just wondering if there is a clean and eloquent way of returning all values from an associative array that do not match a given key(s)? This is what I’m (going to be) using, however, are there cleaner implementations, something I missed in the manual perhaps? Answer You could just unset the value: Edit: Made it clearer.

Advertisement