Is there any easy way to get the hightest numeric value of an associative array?
$array = array(
0 => array(
'key1' => '123',
'key2' => 'values we',
'key3' => 'do not',
'key4' => 'care about'
),
1 => array(
'key1' => '124',
'key2' => 'values we',
'key3' => 'do not',
'key4' => 'care about'
),
2 => array(
'key1' => '125',
'key2' => 'values we',
'key3' => 'do not',
'key4' => 'care about'
)
);
AwesomeFunction($array, 'key1'); // returns 2 ($array key)
Please be kind since this question was written with a phone. Thanks.
See Question&Answers more detail:os