I need to test if a specific key/value exists and then return the array index that the key/value is a member of without having to loop through each element and/or levels of the array. Is this possible?
[0:
{ regional:
[ 0 :
{
ID: 1000
someInfoA : valueA
someInfoB : valueB
}
]
[ 1 :
{
ID: 1001
someInfoA : valueA
someInfoB : valueB
}
]
[ 2 :
{
ID: 1002
someInfoA : valueA
someInfoB : valueB
}
]
[ 3 :
{
ID: 1003
someInfoA : valueA
someInfoB : valueB
}
]
}
{ national :
[ ... ]
[ ... ]
}
]
In this data example, I need to see if ID: 1002 exists and if it does, return the array index: [2], if not return false. i have seen various ways of just determining if the key/value exists but I haven't seen a non-loop method for returning the array index it belongs to.