ez.no / exponential / documentation / reference / template operators / arrays / extract
$input_array|extract( $offset [, $length ] )
| Name | Type | Description | Required |
|---|---|---|---|
| offset | integer | Offset of array extraction | yes |
| length | integer | Number of elements to extract | no |
New array containing extracted elements.
The extract operator will return a portion of an inputted array. The returned portion is defined by the offset and length parameters. If length is omitted, the rest of the array (from offset) will be returned.
{array( 1, 2, 3, 4, 5, 6, 7 )|extract( 2 )}
returns the array( 3, 4, 5, 6, 7 ).
{array( 1, 2, 3, 4, 5, 6, 7 )|extract( 3, 3 )}
returns the array( 4, 5, 6 ).
log in or create a user account to comment.
Comments