Skip to content

Kirby 4.5.0

A::implode()

Join array elements as a string, also supporting nested arrays

A::implode(array $array, string $separator = ''): string

Parameters

Name Type Default
$array * array
$separator string ''

Return type

string

Parent class

Kirby\Toolkit\A

Example

$array = ['a', 'b', ['cc', 'dd']];

A::implode($array); // abccdd
A::implode($array, ', '); // a, b, cc, dd