The |implode
filter is used to join array elements into a string. The elements are glued by a separator.
For example, from [(#SET{my_table, #ARRAY{cle1, 1999, cle2, 12, cle3, 31}})]
, [(#GET{my_table}|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