I have an array where I want to search the uid and get the key of the array.
uid
Assume we have the following 2-dimensional array:
In later versions of PHP (>= 5.5.0) you can use this one-liner:
$key = array_search('100', array_column($userdb, 'uid'));