How to assign and create associative array with multiple keys

i found this thread where i want to implement something similar but to add on top of that i would also like to see how can i only search for id in the entire array and if it matches then matches then deelte, sort of LRU funcctionality .
Can anyone help on this ?