The SplDoublyLinkedList::key() function is an inbuilt function in PHP which is used to return the index of the current node.
mixed SplDoublyLinkedList::key( void )
Parameters: This function does not accepts any parameters.
Return Value: It returns the index of current node.
Below programs illustrate the SplDoublyLinkedList::key() function in PHP:
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.