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 Create Quiz Comment R R_Raj Follow 0 Improve R R_Raj Follow 0 Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_set Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like