I am trying to get value of is_activated column key. But can not get the exact value. Have tried array_search()
Review the array
Need to check value of all is_activated key whether it's value is 1 or not.
Array
(
[0] => Array
(
[first_name] => Array
(
[0] => john
)
[is_activated] => Array
(
[0] => 0
)
)
[1] => Array
(
[first_name] => Array
(
[0] => mark
)
[is_activated] => Array
(
[0] => 1
)
)
[2] => Array
(
[first_name] => Array
(
[0] => pretik
)
[is_activated] => Array
(
[0] => 0
)
)
)
I have tried this below solution but can can not get result.
$is_user_activated = array_search(1,array_column($activity,'is_activated'));
if($is_user_activated == 1) { echo 'yes'; }
else { echo 'no'; }
is_activatedcolumn's value is array