• PHP Video Tutorials

PHP - Ds Sequence join() Function


Advertisements

Ds\Sequence::join() function can join all values together as a string.

Syntax

public abstract string Ds\Sequence::join([ string $glue ] )

Ds\Sequence::join() function can join all values together as a string using an optional separator between each value.

Ds\Sequence::join() function can return all values of a sequence joined together as a string.

Example 1

<?php 
   $seq =  new \Ds\Vector(["R", "A", "J", "A", "T", 1, 2, 3, 4]); 
   var_dump($seq->join());
?>

Example 2

<?php 
   $seq =  new \Ds\Vector(["R", "A", "J", "A", "T", 1, 2, 3, 4]);  
   var_dump($seq->join(", ")); 

   $seq =  new \Ds\Vector([1, 2, 3, "r", "a"]);
   var_dump($seq->join("|")); ?>
php_function_reference.htm
Advertisements