Given an array:
$a = array( \'abc\', 123, \'k1\'=>\'v1\', \'k2\'=>\'v2\', 78, \'tt\', \'k3\'=>\'v3\' );
Wi
Generally speaking doubly linked list would be ideal for this task.
There is a built-in implementation of that since PHP 5.3, called SplDoublyLinkedList and since PHP 5.5 it also has add method, which allows adding/inserting values in the middle.