|implode

The filter |implode applies to an array.

The ’|implode’ filter is used to join array elements into a string. The elements are glued by a separator.

For example, from

 [(#SET{mon_tableau, #ARRAY{cle1, 1999, cle2, 12, cle3, 31}})]
[(#GET{mon_tableau}|implode{-})]

will return: "1999-12-31"

Warning:
-  if the separator is the comma character, it should be enclosed in single quotes:

[(#GET{my_array}|implode{','})]


-  To make the filter more convenient to use in templates, ’|implode’ reverses the writing of the PHP function of the same name.


See also the filter |explode

Author jack Published : Updated : 14/07/23

Translations : English, français, Nederlands