insert

Summary

Inserts an element/sequence at specified position in array.

Usage

$input_array|insert( offset, element1 [, element2 [, ... ] ] )

Parameters

NameTypeDescriptionRequired
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
...

Returns

Array containing original array and inserted elements.

Description

This operator inserts an element sequence of elements at a specified position in an array. Returns the original array with the inserted values.

Examples

{array( 1, 2, 5 )|insert( 2, 3, 4 )}

returns the array(1,2,3,4,5).

Comments

log in or create a user account to comment.

Contents

Reference

Database diagram
Template operators
    PDF
    Arrays
       array_sum
       append
       array
       array_append
       array_merge
       array_prepend
       begins_with
       compare
       contains
       ends_with
       explode
       extract
       extract_left
       extract_right
       hash
       implode
       insert
       merge
       prepend
       remove
       repeat
       reverse
       array_sum
       unique
    Data extraction
    Formatting
    Images
    Logic
    Mathematics
    Miscellaneous
    Strings
    URLs
    Variables
Template functions
Data fetching
Modules
XML tags


Created

05/02/2004
10:32:55 am
by Balazs Halasy

Last updated

19/01/2005
8:23:02 am
by Rune Langseid

Authors

Balazs Halasy
Kåre Køhler Høvik
Rune Langseid



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.