implode

Summary

Joins array elements with strings.

Usage

$input_array|implode( $separator )

Parameters

NameTypeDescriptionRequired
separator string String to insert between array elements yes

Returns

String containing array elements separated by the specified separator.

Description

Returns a string containing a string representation of all the array elements (from the inputted array) in the same order, with the separator string between each element.

Examples

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

returns the string "1, 2, 3, 4, 5, 6, 7".

{array( 1, 2, 3, 4, 5, 6, 7 )|implode( "_-_" )}

returns the string "1_-_2_-_3_-_4_-_5_-_6_-_7".

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:32:38 am
by Balazs Halasy

Last updated

19/02/2004
1:43:42 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.