I hope this is the best way to ask this. Not sure how to word it. I was thinking there is a native PHP function to determine this, which leads me to think that maybe my wording in searches isn't the best.
I want to search my array for a specific [key] => [value].
If that [key] => [value] is found within my array I want to get another [key] => [value] from its array parent.
Examples from my code below to explain.
Example 1:
If [post_type] = [page] I want to get [activate_layout] = [value] from array [0].
Example 2:
If [post_type] = [post] I want to get [activate_layout] = [value] from array [1].
General Concept Example 3:
If [post_type] = [x] I want to get [activate_layout] = [x] from its parent array [x].
My question is how can I differentiate a [key] and [value] from another [key] and [value] by its parent array [key]?
Below is how my array data is stored.
[post_type_layouts] => Array
(
[0] => Array
(
[context] => Array
(
[option] => Array
(
[activate_layout] => 1
[post_type] => page
)
)
)
[1] => Array
(
[context] => Array
(
[option] => Array
(
[activate_layout] => 1
[post_type] => post
)
)
)
)