I have an array where I need to find the max value. I have looked at many examples and logged questions here but I can not seem to find an answer to my specific issue.
Array
(
[0] => Array
(
[xaxis] => Test Test Test
[yaxis] => 19875.00
)
[1] => Array
(
[xaxis] => Test1
[yaxis] => 10375.00
)
[2] => Array
(
[xaxis] => Test2
[yaxis] => 76000.00
)
[3] => Array
(
[xaxis] => test3
[yaxis] => 4451.61
)
[4] => Array
(
[xaxis] => test4
[yaxis] => 6225.81
)
[5] => Array
(
[xaxis] => test5
[yaxis] => 3000.00
)
[6] => Array
(
[xaxis] => test6
[yaxis] => 2000.00
)
)
I have tried the following:
echo max($data[0]['yaxis']);
This will give an error obviously
echo max($data[0]);
This returns 'Test Test Test' instead of the correct '76000'
echo max($data);
This returns 'array'