I have an array like this:
$programs=[
'user1'=>[
'value 1',
'value 2',
],
'user2'=>[
'value 3',
],
'user3'=>[
'value 4',
],
];
I would like to get the “user” corresponding with the value without having to loop through the array every time.
The following only works when having keys in the nested array:
$key=array_search('value 3', array_column($programs, 0));