Got a question that the wiki doesn't answer? Ask on the forum (preferred), or join us on IRC.


CommandHelper/Staged/API/array implode

From Wiki
Jump to: navigation, search

Vital Info

Name array_implode
Returns string
Usages array, [glue]
Throws CastException
Since 3.3.0
Optimizations None


Given an array and glue, to-strings all the elements in the array (just the values, not the keys), and joins them with the glue, defaulting to a space. For instance array_implode(array(1, 2, 3), '-') will return "1-2-3".


array_implode(array, [glue])

Examples (How do these work?)

Example 1

Basic usage

Given the following code:

1   array_implode(array(1, 2, 3), '-')

The output would be:


Example 2

With associative array

Given the following code:

1   array_implode(array(one: 'a', two: 'b', three: 'c'), '-')

The output would be:


See Also

split, reg_split

Navigation menu