remove

Summary

Removes element(s) from an array.

Usage

$input_array|remove( offset [, length ] )

Parameters

NameTypeDescriptionRequired
offset integer Offset to remove elements from yes
length integer Number of elements to remove no

Returns

Array with specified elements removed.

Description

The remove operator simply removes element(s) from array (and returns the chopped version of the array). The offset parameter defines the start of the portion to be removed while the length prameter defines the length of the portion.

When no length is specified, all elements from offset are removed.

Examples

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

returns the array(1,2,5).

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

returns the array(1,2).

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:33:46 am
by Balazs Halasy

Last updated

05/02/2004
2:36:30 pm
by Kåre Køhler Høvik

Authors

Balazs Halasy
Kåre Køhler Høvik



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.