explode

Summary

Splits an array into an array of subarrays.

Usage

$input_array|explode( $offset )

Parameters

NameTypeDescriptionRequired
offset integer Array offset to split array yes

Returns

Array containing the original array split into two arrays.

Description

The explode operator will expect an array as input. It will expect the parameter to be an integer offset specifying where to split the array in two. It will return an array containing the two resulting arrays.

Examples

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

returns the following array: ( array( 1, 2, 3 ), array( 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:31:11 am
by Balazs Halasy

Last updated

05/02/2004
11:56:19 am
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.