Wednesday, 7 August 2013

PHP getting max value from array

PHP getting max value from array

hi following are output of an array:
Array
(
[0] => stdClass Object
(
[id_category] => 68, 67
[cost] => 99
)
[1] => stdClass Object
(
[id_category] => 70
[cost] => 100
)
[2] => stdClass Object
(
[id_category] => 70
[cost] => 10
)
)
How is possible to use array to filter only max value? SO the output will
only be
Array
(
[0] => stdClass Object
(
[id_category] => 70
[cost] => 100
)
)
Thanks.

No comments:

Post a Comment