Consider the following array returned from an API:
$arr = Array
(
[A] =>
[C] =>
[D] =>
[EE] => Array
(
[0] => Array
(
[B] =>
[C] => 2.06
[O] =>
[P] => 0
[T] => 1
)
[1] => Array
(
[B] =>
[C] => 2.56
[O] =>
[P] => 0
[T] => 2
)
[2] => Array
(
[B] =>
[C] => 4.94
[O] =>
[P] => 0
[T] => 3
)
[3] => Array
(
[B] =>
[C] => 1.42
[O] =>
[P] => 1
[T] => 9
)
[4] => Array
(
[B] =>
[C] => 2.83
[O] =>
[P] => 1
[T] => 10
)
[5] => Array
(
[B] =>
[C] => 2.13
[O] =>
[P] => 1.5
[T] => 9
)
[6] => Array
(
[B] =>
[C] => 1.7
[O] =>
[P] => 1.5
[T] => 10
)
)
)
I want to get the C value from the sub array where P is 1.5 and T is 9. Obviously if I knew this would always be in sub array with index 5 I could just do this:
$arr['EE'][5]['C'];
But 5 will not always be the index of that particular array. So I'm looking for something more along the lines of:
$arr['EE'][...P is 1.5 and T is 9...]['C'];
This is within a loop that processes thousands of these arrays, so performance is definitely a consideration. In other words, I don't want to do a bunch of nested loops to find that value - I'm looking for a built-in PHP function for this (or a combination thereof) if it exists.