+

PHP Ds / Sequence merge () function

Syntax:
abstract public DsSequence::merge ($values): DsSequence
Parameter:this function takes one $values ​​ parameter which contains elements.Return value:this function returns the sequence of adding all elements. The following programs illustrate the Ds / Sequence::merge() function in PHP:Program 1:  
// Create a new sequence $seq = new DsVector ([12, 15, 18, 20]);  
// Merge the sequence and display it var_dump ( $seq -> merge ([1, 2, 3]));  
// Show sequence item var_dump ( $seq ) ?>
Output:
object (DsVector) # 2 (7) {[0] = > int (12) [1] = > int (15) [2] = > int (18) [3] = > int (20) [4] = > int (1) [5] = > int (2) [6] = > int (3)} object (DsVector) # 1 (4) {[0] = > int (12) [1] = > int (15) [2] = > int (18) [3] = > int (20)}
Program 2:  
// Create a new sequence $seq = new DsVector ([12, 15 , 18, 20]);  
// Merge the sequence and display it var_dump ( $seq -> merge ([ "G" , "E" , "E" , "k" , "S" ]));  
?>
Output:
object (DsVector) # 2 (9) {[0] = > int (12) [1] = > int (15) [2] = > int (18) [3] = > int (20) [4] = > string (1) "G" [5] = > string (1) "E" [6] = > string (1) "E" [7] = > string (1) "k" [8] = > string (1) "S"}
Link: http: //php.net/manual/en/ds-sequence.merge.php
Get Solution for free from DataCamp guru