• PHP Video Tutorials

PHP - Ds\PriorityQueue::push() Function



Ds\PriorityQueue::push() function can push the values with a given priority into a queue.

Syntax

public void Ds\PriorityQueue::push( mixed $value , int $priority )

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

Example

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