• PHP Video Tutorials

PHP - Ds\Queue::clear() Function



Ds\Queue::clear() function can remove all values from a queue.

Syntax

public void Ds\Queue::clear( void )

Ds\Queue::clear() function doesn't have any parameters.

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

Example

<?php  
   $queue = new \Ds\Queue();  
  
   $queue->push("Tutorials"); 
   $queue->push("Point"); 
   $queue->push("India"); 
  
   echo "The initial queue is: \n"; 
   print_r($queue); 
  
   $queue->clear(); 
  
   echo "\n The queue after clear() function is: \n"; 
   print_r($queue); 
?>
php_function_reference.htm
Advertisements