removeKeys.php
Table of Contents
Functions
- removeKeys() : array<string|int, mixed>
- Removes a set of keys from an array.
Functions
removeKeys()
Removes a set of keys from an array.
removeKeys(array<string|int, mixed> $array[, array<string|int, mixed> $keys = [] ][, bool $clone = false ]) : array<string|int, mixed>
This function removes the specified keys from the given array.
If $clone
is set to true
, the original array is not modified; instead, a new array is returned.
Otherwise, the original array is modified directly (passed by value).
Parameters
- $array : array<string|int, mixed>
-
The input array to modify or clone.
- $keys : array<string|int, mixed> = []
-
An array of keys to remove from the input array.
- $clone : bool = false
-
If true, operates on a copy of the array and returns it; otherwise, modifies the array in place (by value).
Tags
Return values
array<string|int, mixed> —The resulting array with specified keys removed.