PUBLIE : |implode

**SPIP**

# Article validé

L’article "**|implode** (https://www.spip.net/en_article6569.html)" vient
d’être publié par b_b.

* * *

## |implode

mardi 26 mai 2020 , par [jack](.././?page=auteur&id_auteur=593&)

The filter `|implode` applies to an array.

The **`|implode`** filter is used to gather an array into a string
containing the elements linked 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
(https://www.spip.net/ecrire/?exec=article&id_article=6568)

— Envoyé par SPIP (https://www.spip.net/)

rubon199.jpg

puce.gif