如何从最高和最低数组值获取键/值对? [重复]

This question already has an answer here:

I have a simple array like this:

Array(
    [a] =>  1,
    [b] =>  5,
    [c] => 10
)

Now I want to get the key/value pair for the highest and lowest array value. Means the expected output would be:

//Max value
Key:    c
Value: 10
//Min value
Key:    a
Value:  1

I tried something like this:

$max_key = max( array_keys( $array ) ); 
</div>

Well you almost named then, max() and min() return the max value and min value of array

echo max(array(2, 4, 5)); // 5
echo min(array(2, 4, 5)); // 2