• PHP Video Tutorials

PHP - Ds\Queue::push() Function



Ds\Queue::push() function can push the values into a queue.

Syntax

public void Ds\Queue::push([ mixed $...values ] )

Ds\Queue::push() function doesn't return any value.

Example-1

<?php  
   $queue = new \Ds\Queue();  
   $queue->push("Tutorials"); 
   $queue->push("Point"); 
   $queue->push("India"); 
  
   echo "The queue is: \n"; 
   print_r($queue); 
?>

Example-2

<?php  
   $queue = new \Ds\Queue();  
   $queue->push("Tutorials"); 
   $queue->push("Point", "2"); 
   $queue->push("India", "3", "4"); 
  
   echo "The queue is: \n"; 
   print_r($queue); 
?>
php_function_reference.htm
Advertisements