omit.php
Table of Contents
Functions
- omit() : array<string|int, mixed>
- Omits a set of keys from an array.
Functions
omit()
Omits a set of keys from an array.
omit(array<string|int, mixed> $array, array<string|int, mixed> $keys) : array<string|int, mixed>
This function is a semantic alias of removeKeys(). It returns a new array without the specified keys.
The naming is intentionally security- and data-filtering-oriented, making it well suited for excluding sensitive or unwanted fields (e.g. passwords, tokens, internal metadata).
Parameters
- $array : array<string|int, mixed>
-
The input array to filter.
- $keys : array<string|int, mixed>
-
The list of keys to omit from the array.
Tags
Return values
array<string|int, mixed> —The filtered array without the specified keys.