How to check if an array key exist or not array within array?
I need check the user id exist in array, i have below array found,
Array
(
[0] => Array
(
[user_id] => 1482309797
[week] => 1
[type] => 1
[commission] => 4000
)
[1] => Array
(
[user_id] => 1482309797
[week] => 1
[type] => 1
[commission] => 0
)
[2] => Array
(
[user_id] => 1482309797
[week] => 1
[type] => 1
[commission] => 4000
)
[3] => Array
(
[user_id] => 1482309797
[week] => 1
[type] => 1
[commission] => 0
)
[4] => Array
(
[user_id] => 1483096072
[week] => 1
[type] => 1
[commission] => 4000
)
[5] => Array
(
[user_id] => 1483333245
[week] => 1
[type] => 1
[commission] => 2000
)
)
I want to check if the user id exist or not, i have tried below code
foreach ($com_array as $report) {
$user_id=$report['user_id'];
if(array_key_exists($user_id,$output_array)){
echo "Eid found";
}else{
echo "id not found";
}
}
any one Please help.