ez.no / exponential / documentation / reference / template operators / arrays / insert
$input_array|insert( offset, element1 [, element2 [, ... ] ] )
| Name | Type | Description | Required |
|---|---|---|---|
| offset | integer | Offset to insert element(s) at | yes |
| element1 | mixed | Element to insert into existing array | yes |
| element2 | mixed | Element to insert into existing array | no |
| ... |
Array containing original array and inserted elements.
This operator inserts an element sequence of elements at a specified position in an array. Returns the original array with the inserted values.
{array( 1, 2, 5 )|insert( 2, 3, 4 )}
returns the array(1,2,3,4,5).
log in or create a user account to comment.
Comments