function array_interleave($interleave, $array)Arcanist Technical Documentation ()
function array_interleave($interleave, $array)
Arcanist Technical Documentation ()
Add an element between every two elements of some array. That is, given a list A, B, C, D, and some element to interleave, x, this function returns A, x, B, x, C, x, D. This works like implode(), but does not concatenate the list into a string. In particular:
implode('', array_interleave($x, $list));
...is equivalent to:
implode($x, $list);
This function does not preserve keys.
Parameters
wild | $interleave | Element to interleave. |
list | $array | List of elements to be interleaved. |
Return
list | Original list with the new element interleaved. |
- Defined
- src/utils/utils.php:983