ez.no / exponential / documentation / reference / template operators / arrays / remove
$input_array|remove( offset [, length ] )
| Name | Type | Description | Required |
|---|---|---|---|
| offset | integer | Offset to remove elements from | yes |
| length | integer | Number of elements to remove | no |
Array with specified elements removed.
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.
{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).
log in or create a user account to comment.
Comments