PHP | Ds\Sequence join() Function Last Updated : 21 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Ds\Sequence::join() function is an inbuilt function in PHP which is used to join all values as string. Syntax: string abstract public Ds\Sequence::join ([ string $glue ] ) Parameter: This function accepts single parameter $glue which is optional. It is used to separate the sequence element. Return value: This function returns a strings. Below programs illustrate the Ds\Sequence::join() function in PHP: Program 1: php <?php // Create new sequence $seq = new \Ds\Vector(["G", "E", "E", "K", "S", 1, 2, 3, 4]); // Use join() function and // display the string var_dump($seq->join()); ?> Output: string(9) "GEEKS1234" Program 2: php <?php // Create new sequence $seq = new \Ds\Vector(["G", "E", "E", "K", "S", 1, 2, 3, 4]); // Use join() function and // display the string separated // with comma var_dump($seq->join(", ")); // Create new sequence $seq = new \Ds\Vector([1, 2, 3, "g", "e"]); // Use join() function var_dump($seq->join("|")); ?> Output: string(25) "G, E, E, K, S, 1, 2, 3, 4" string(9) "1|2|3|g|e" Reference: http://php.net/manual/en/ds-sequence.join.php Comment More infoAdvertise with us Next Article PHP | DsDeque slice() Function V vijay_raj Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-DS\Collection Similar Reads PHP | DsSet join() Function The Ds\Set::join() function is an inbuilt function in PHP which is used to join all values as string. Syntax: string public Ds\Set::join ([ string $glue ] ) Parameters: This function accepts single parameter $glue which is optional. It is used to separate the set element. Return Value: This function 1 min read PHP | DsDeque join() Function The Ds\Deque::join() function is an inbuilt function in PHP which is used to join all values in the Deque as a string. The separator can also be used to join the elements. Syntax: public Ds\Deque::join( $glue ) : string Parameters: This function accepts single parameter $glue which holds the separat 2 min read PHP | DsVector join() Function The Ds\Vector::join() function is an inbuilt function in PHP which is used to join all the elements of vector as a string using the separator provided as the argument. Syntax: string public Ds\Vector::join( $glue ) Parameters: This function accepts a single parameter $glue which is used to hold the 1 min read PHP | DsSet slice() Function The Ds\Set::slice() function is an inbuilt function in PHP which is used to return the sub-set of given range. Syntax: Ds\Set public Ds\Set::slice ( int $index [, int $length ] ) Parameters: This function accepts two parameters as mentioned above and described below: $index: This parameter holds the 2 min read PHP DsSet sum() Function The Ds\Set::sum() function of Ds\Set class in PHP is an inbuilt function which is used to find the sum of all of the elements present in a Set. Syntax: number public Ds\Set::sum ( void ) Parameter: This function does not accepts any parameter. Return Value: This function returns the sum of the value 1 min read PHP | DsSequence join() Function The Ds\Sequence::join() function is an inbuilt function in PHP which is used to join all values as string. Syntax: string abstract public Ds\Sequence::join ([ string $glue ] ) Parameter: This function accepts single parameter $glue which is optional. It is used to separate the sequence element. Retu 1 min read PHP | DsDeque slice() Function The Ds\Deque::slice() function is an inbuilt function in PHP which is used to return a sub-Deque which contains elements of the Deque within the index range. Syntax: public Ds\Deque::slice( $index, $length ) : Ds\Deque Parameters: This function accept two parameters as mentioned above and described 2 min read PHP | DsMap reverse() Function The Ds/Map::reverse() function in PHP is used to in-place reverse the elements of a specified Map instance. That is, the function in-place reverses the order of elements present in the specified Map instance. Syntax: Ds\Map public Ds\Map::reverse ( int $position ) Parameter: This function does not a 2 min read PHP | DsSequence reduce() Function The Ds\Sequence::reduce() function is an inbuilt function in PHP which is used to reduce the sequence to a single value using a callback function. Syntax: mixed abstract public Ds\Sequence::reduce ( callable $callback [, mixed $initial ] ) Parameters: This function accepts two parameters as mentione 2 min read PHP | DsMap union() Function The Ds\Map::union() function is an inbuilt function in PHP which is used to create a new map which contains the union of two maps. Syntax: Ds\Map Ds\Map::union( $map ) Parameters: This function accepts single parameter $map which is used to hold the other map of the instance to combine with the curr 2 min read Like