PHP | Ds\Set join() Function Last Updated : 16 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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 returns a string. Below programs illustrate the Ds\Set::join() function in PHP: Program 1: php <?php // Create new set $set = new \Ds\Set(["G", "E", "E", "K", "S", 1, 2, 3, 4]); // Use join() function and // display the string var_dump($set->join()); ?> Output: string(8) "GEKS1234" Program 2: php <?php // Create new set $set = new \Ds\Set(["G", "E", "E", "K", "S", 1, 2, 3, 4]); // Use join() function and // display the string separated // with comma var_dump($set->join(", ")); // Create new set $set = new \Ds\Set([1, 2, 3, "g", "e"]); // Use join() function var_dump($set->join("|")); ?> Output: string(22) "G, E, K, S, 1, 2, 3, 4" string(9) "1|2|3|g|e" Reference: https://www.php.net/manual/en/ds-set.join.php Comment More infoAdvertise with us Next Article PHP | DsDeque join() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_set 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 | DsDeque set() Function The Ds\Deque::set() function is an inbuilt function in PHP which is used to set the value at the given index in the Deque. Syntax: public Ds\Deque::set( $index, $value ) : void Parameters: This function accept two parameters as mentioned above and described below: index: This parameter holds the ind 2 min read PHP | DsVector set() Function The Ds\Vector::set() function is an inbuilt function in PHP which is used to set the value in the vector at the given index. Syntax: void public Ds\Vector::set( $index, $value ) Parameters: This function accepts two parameters as mentioned above and described below: $index: This parameter holds the 2 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 Like