Files
smarty/docs/designers/language-modifiers/language-modifier-join.md
Simon Wisselink 41d80b99ac Implemented support for substr, implode and json_encode as modifiers. (#940)
* Implemented support for substr, implode and json_encode as modifiers. Fixes #939
* Added split and join in favor of explode and implode modifiers.
* Documented all available modifiers
2024-02-26 14:35:19 +01:00

26 lines
690 B
Markdown

# join
Returns a string containing all the element of the given array
with the separator string between each.
## Basic usage
For `$myArray` populated with `['a','b','c']`, the following will return the string `abc`.
```smarty
{$myArray|join}
```
## Parameters
| Parameter | Type | Required | Description |
|-----------|--------|----------|-------------------------------------------------------------|
| 1 | string | No | glue used between array elements. Defaults to empty string. |
## Examples
For `$myArray` populated with `[1,2,3]`, the following will return the string `1-2-3`.
```smarty
{$myArray|join:"-"}
```