Arrays
Table of Contents
Packages
Functions
- array_interchange() : array<string|int, mixed>
- Interchange the values of two elements of an array.
Functions
array_interchange()
Interchange the values of two elements of an array.
array_interchange(array<string|int, mixed> $array, TKey $key1, TKey $key2) : array<string|int, mixed>
If a key doesn't exist in the array, then the other key will be set
to null
, and a warning will be thrown.
Parameters
- $array : array<string|int, mixed>
- $key1 : TKey
- $key2 : TKey