← All built-ins / implode()
implode()
implode(...$args): string
Parameters
| Name | Type | Description |
|---|---|---|
| $glue | string | separator between elements |
| $arr | array | array of strings/numbers |
Return value
All elements joined by $glue.
Example
echo implode(", ", ["a", "b", "c"]), "
";
echo implode("-", [1, 2, 3]), "
";a, b, c 1-2-3