ExtendedArray helper
1Presentation
Helper for additional table processing functionalities.
2Static methods
2.1fusion()
This static method merges two arrays.
When a key is numeric, it is merged like PHP's array_merge_recursive() function. When a key is textual, it is merged like PHP's array_replace_recursive() function.
If a key contains the suffix __prepend, its contents are added to the beginning of the contents of the corresponding key without the suffix.
Method signature:
fusion(?array $array1, ?array $array2) : array
Parameters :
- $array1: First array to merge.
- $array2: Second array to merge.
2.2hasOnlyScalarValues()
This static method tells if an array contains only scalar values.
Method signature:
hashOnlyScalarValues(?array $array) : bool
Parameter :
- $array: The array to analyze.
Returned value: true if the array contains only scalar values, or is empty or null.