• PHP Video Tutorials

PHP - Ds\Queue::toArray() Function



Ds\Queue::toArray() function can convert the queue to an array.

Syntax

public array Ds\Queue::toArray( void )

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

Ds\Queue::toArray() function can return an array containing all values in the same order as queue.

Example

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