Page MenuHomePhorge

function array_interleave($interleave, $array)
libphutil Technical Documentation (Core Utilities)

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$interleaveElement to interleave.
list$arrayList of elements to be interleaved.
Return
listOriginal list with the new element interleaved.