I have an array where I want to search the uid
and get the key of the array.
Assume we have the following 2-dimensional array:
<
I want to check tha in the following array $arr
is there 'abc' exists in sub arrays or not
$arr = array(
array(
'title' => 'abc'
)
);
Then i can use this
$res = array_search('abc', array_column($arr, 'title'));
if($res == ''){
echo 'exists';
} else {
echo 'notExists';
}
I think This is the Most simple way to define