merge.php
Table of Contents
Functions
- merge() : array<string|int, mixed>
- Merges two arrays using MergeOption normalized settings.
Functions
merge()
Merges two arrays using MergeOption normalized settings.
merge(array<string|int, mixed> $original, array<string|int, mixed> $external[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
This function provides a flexible way to merge arrays, supporting:
- Deep recursive merging of nested arrays.
- Indexed sub-array storage for multiple values.
- Unique value enforcement in lists.
- Configurable handling of null values ('skip', 'keep', 'overwrite').
- Optional cleaning of the result using CleanFlag constants.
Parameters
- $original : array<string|int, mixed>
-
The original array to merge into.
- $external : array<string|int, mixed>
-
The array whose values will be merged into the original.
- $options : array<string|int, mixed> = []
-
Optional MergeOption array to control merge behavior.
Tags
Return values
array<string|int, mixed> —The merged array, optionally cleaned according to CleanFlag.