PHP Ds\Queue toArray() Function Last Updated : 23 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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. Syntax: 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: php <?php // Declare new Queue $q = new \Ds\Queue(); // Add elements to the Queue $q->push("One", 1); $q->push("Two", 2); $q->push("Three", 3); echo "The equivalent array is: \n"; print_r($q->toArray()); Output: The equivalent array is: Array ( [0] => One [1] => 1 [2] => Two [3] => 2 [4] => Three [5] => 3 ) Reference: http://php.net/manual/en/ds-queue.toarray.php Comment More infoAdvertise with us Next Article PHP | DsDeque toArray() Function gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_queue Similar Reads PHP DsMap toArray() Function The Ds\Map::toArray() function in PHP is used to get an array generated by converting the Map instance into an Array. The resulting array is an associative array with elements as in same order as that of the specified Map instance. Syntax: array public Ds\Map::toArray ( void ) Parameter: This functi 1 min read PHP DsQueue toArray() Function 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. Syntax: array public Ds\Queue::toArray ( void ) Parameters: This function does not accepts any pa 1 min read PHP | DsDeque toArray() Function The Ds\Deque::toArray() function is an inbuilt function in PHP which is used to convert a Deque into an array. The elements of the array will be in the same order as they are in Deque. Syntax: public Ds\Deque::toArray( void ) : array Parameters: This function does not accept any parameter. Return Va 2 min read PHP | DsStack toArray() Function The Ds\Stack::toArray() function of PHP is used to convert the stack to an array and returns the converted array. This function does not modify the actual Stack. Syntax: void public Ds\Stack::toArray () Parameters: This function does not accept any parameters. Return Value: This function returns the 2 min read PHP | DsVector toArray() Function The Ds\Vector::toArray() function is an inbuilt function in PHP which is used to convert the vector into an array. All the elements of the vector are copied to the array.Syntax: array public Ds\Vector::toArray( void ) Parameters: This function does not accepts any parameters.Return Value: This funct 2 min read PHP | DsCollection toArray() Function The Ds\Collection::toArray() function is an inbuilt function in PHP which is used to converts the collections into array. Syntax: public Ds\Collection::toArray( void ) : array Parameters: This function does not accepts any parameters. Return Value: This function returns an array containing all colle 1 min read PHP DsPriorityQueue toArray() Function The Ds\PriorityQueue::toArray() Function in PHP is used to convert a PriorityQueue into an associative array in PHP. The values of the PriorityQueue are assigned to the array in order of decreasing priority. Syntax: array public Ds\PriorityQueue::toArray ( void ) Parameters: This function does not a 1 min read PHP SplFixedArray toArray() Function The SplFixedArray::toArray() function is an inbuilt function in PHP which is used to get a PHP array from the fixed array. Syntax: array SplFixedArray::toArray() Parameters: This function does not accept any parameter. Return Value: This function returns a PHP array. Below programs illustrate the Sp 1 min read PHP SplQueue::dequeue() Function The SplQueue::dequeue() function is an inbuilt function in PHP which is used to dequeues the node from the queue. Syntax: mixed SplQueue::dequeue() Parameters: This function does not accept any parameter. Return Value: This function return the value of the dequeued node. Below programs illustrate th 1 min read PHP SplQueue::__construct() Function The SplQueue::__construct() function is an inbuilt function in PHP which is used to construct a queue which is implemented using a doubly-linked list. Syntax: void SplQueue::__construct(void) Parameters: This function does not accept any parameter. Return Value: This function does not return any val 1 min read Like