The deal here is that I have an array with 17 elements. I want to get the elements I need for a certain time and remove them permanently from the array.
Here\'s the
Use array_diff_key to remove
$remove = ['telephone', 'country']; array_diff_key($post, array_flip($remove));
You could use array_intersect_key if you wanted to supply an array of keys to keep.