I've an array like
protected $aPermissions = [
'read' => [
'show'
],
'update' => [
'edit',
'editProfilePicture'
]
];
and I want to get the array key for the sub-array ('read', 'update') by a value to possibly find within the sub-array. So searching for 'edit' would return 'update', whereas 'show' would return 'read'.
I tried PHP's array_search function (also recursively, in a loop), but didn't manage to get this to work. What's the best approach to achieve what I want?