Array
(
[0] => Array
(
[user_id] => 1
[name] => Jacob
[email] => jac@xyz.com
[type] => 1
)
[1] => Array
(
[user_id] => 21
[name] => Agile
[email] => agi@xyz.com
[type] => 2
)
[2] => Array
(
[user_id] => 23
[name] => Sam
[email] => same@xyz.com
[type] => 3
)
)
foreach ($users as $key => $value) {
# code...
if(($value['type'] == 1 || $value['type'] ==2) && $value['type'] != 3) {
echo "lost because 3 exists there."
}
}
I would like to find if in this array type 3 does not exist but type 1,2 exist I would like a condition where type 1 or type 2 is acceptable but it type 3 exist it should say lost because of 3 exists.