If there is a way by which array_search()
would return key of its first conflict like if I run
$key = array_search(40489, array_column($userdb, 'uid'));
on
Array
(
(1) => Array
(
(uid) => '5465',
(name) => 'Stefanie Mcmohn',
(pic_square) => 'urlof100'
),
(2) => Array
(
(uid) => '40489',
(name) => 'Michael',
(pic_square) => 'urlof40489'
)
);
it would ideally return
2
but I want it to return
1
i.e the first element that did not have the 'uid' = 40489 &
If its not possible with array_search()
is there any other way to do it with loops? I tried array_filter()
but can't get it to work.