mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-08 18:21:03 +02:00
* 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
690 B
690 B
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
.
{$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
.
{$myArray|join:"-"}