• PHP Video Tutorials

PHP - Ds Deque join() Function



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

Syntax

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

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

Ds\Deque::join() function can return all values of the deque joined together as a string.

Example 1

<?php 
   $deque = new \Ds\Deque([1, 2, 3, 4, 5]); 
   echo("The original deque: \n"); 
   print_r($deque); 
   
   echo("\n In the string form:"); 
   var_dump($deck->join("|")); 
?> 

Example 2

<?php 
   $deque = new \Ds\Deque(["Tutorials", "Point", "India"]); 
   echo("The original deque: \n"); 
   print_r($deque); 
   echo("\n The string form:"); 
   var_dump($deque->join()); 
?>
php_function_reference.htm
Advertisements