The Ds\Queue::toArray() Function in PHP is used to convert a Queue into an associative array in PHP. The values of the Queue are assigned to the array in the same order as they are present in the Queue.
array public Ds\Queue::toArray ( void )
Parameters: This function does not accepts any parameters.
Return Value: This function converts the Queue into an associative array and returns the array.
Below program illustrate the Ds\Queue::toArray() Function in PHP:
The equivalent array is: Array (  => One  => 1  => Two  => 2  => Three  => 3 )
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.