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:
my solution:
function searchArrayForField($array, $field, $value) { $i = 0; foreach ($array as &$row) { if ($row[$field] === $value) { return $i; } $i++ } return ''; }