This is the old documentation center for eZ Publish 4. We are currently migrating the eZ Publish documentation to http://confluence.ez.no the eZ Publish 5 documentation platform. Documentation for the eZ Publish legacy components are still located on this site, as well as all documentation for earlier releases.

extract

Summary

Returns a portion of the input array.

Usage

input|extract( offset [, length ] )

Parameters

NameTypeDescriptionRequired
offset integer The offset to start at. Yes.
length integer The number of elements that should be extracted. No.

Returns

An array containing the extracted elements.

Description

This operator will return a portion of the input array. The desired portion must be defined by the "offset" and "length" parameters. If the "length" parameter is omitted, the rest of the array (from offset) will be returned.

Examples

Example 1

{array( 1, 2, 3, 4, 5, 6, 7 )|extract( 2 )}

The following array will be returned: ( 3, 4, 5, 6, 7 ).

Example 2

{array( 1, 2, 3, 4, 5, 6, 7 )|extract( 3, 3 )}

The following array will be returned: ( 4, 5, 6 ).

Balazs Halasy (05/02/2004 10:31 am)

Balazs Halasy (04/05/2005 3:29 pm)


Comments

There are no comments.