• PHP Video Tutorials

PHP - Ds\Queue::count() Function



Ds\Queue::count() function can be used to get the count of elements present in a queue.

Syntax

public int Ds\Queue::count( void )

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

Ds\Queue::count() function can calculate the number of elements present in a queue and return the count.

Example

<?php  
   $queue = new \Ds\Queue();  
   $queue->push("Tutorials");
   $queue->push("Point"); 
   $queue->push("India"); 
  
   print_r($queue->count()); 
?>  
php_function_reference.htm
Advertisements