src/Collection/ImmArray.php
public function join($token = ',', $secondToken = null)
    {
        $ret = '';
        if ($secondToken) {
            foreach ($this as $el) {
                $ret .= $token . $el . $secondToken;
            }
        } else {
            $this->rewind();
            while ($this->valid()) {
                $ret .= (string) $this->current();
                $this->next();
                if ($this->valid()) {
                    $ret .= $token;
                }
            }
        }
        return $ret;
    }
public function join($token = ',', $secondToken = null)
    {
        $ret = '';
        if ($secondToken) {
            foreach ($this as $el) {
                $ret .= $token . $el . $secondToken;
            }
        } else {
            $this->rewind();
            while ($this->valid()) {
                $ret .= (string) $this->current();
                $this->next();
                if ($this->valid()) {
                    $ret .= $token;
                }
            }
        }
        return $ret;
    }
public function join ( $ token = ',' , $ secondToken = null ) { $ ret = '' ; if ( $ secondToken ) { foreach ( $ this as $ el ) { $ ret .= $ token . $ el . $ secondToken ; } } else { $ this -> rewind ( ) ; while ( $ this -> valid ( ) ) { $ ret .= ( string ) $ this -> current ( ) ; $ this -> next ( ) ; if ( $ this -> valid ( ) ) { $ ret .= $ token ; } } } return $ ret ; }
Join a set of strings together.

@param string $token Main token to put between elements
@param string $secondToken If set, $token on left $secondToken on right
@return string
Join a set of strings together .