src/Collection/ArrayCollection.php
public function implode(?string $glue = null, ?callable $callback = null): string
    {
        if ($glue === null) {
            $glue = '';
        }

        if ($callback !== null) {
            return implode($glue, $this->map($callback)->all());
        }

        return implode($glue, $this->all());
    }
public function implode(?string $glue = null, ?callable $callback = null): string
    {
        if ($glue === null) {
            $glue = '';
        }

        if ($callback !== null) {
            return implode($glue, $this->map($callback)->all());
        }

        return implode($glue, $this->all());
    }
public function implode ( ? string $ glue = null , ? callable $ callback = null ) : string { if ( $ glue === null ) { $ glue = '' ; } if ( $ callback !== null ) { return implode ( $ glue , $ this -> map ( $ callback ) -> all ( ) ) ; } return implode ( $ glue , $ this -> all ( ) ) ; }
Concatenates values into a string

Optional callback should return a string value for concatenation.

Callback signature:

<code>
function ($value, $key): string {}
</code>

@param string|null   $glue     The string to join around
@param callable|null $callback The callback function

@return string
Concatenates values into a string