Answer the question
In order to leave comments, you need to log in
How to convert an array to an array with one field maximum in value (with example)?
How can I convert such an array to the one below, that is, leave only the maximum values for one field?
Array
(
[Dima] => Array
(
[0] => Array
(
[id] => 61
[price] => 9
[time] => 2018-03-13 18:31:01
)
[1] => Array
(
[id] => 62
[price] => 6
[time] => 2018-03-13 18:31:01
)
[2] => Array
(
[id] => 63
[price] => 32
[time] => 2018-03-13 18:31:01
)
)
[Nick] => Array
(
[0] => Array
(
[id] => 65
[price] => 68
[time] => 2018-03-13 18:32:01
)
[1] => Array
(
[id] => 67
[price] => 91
[time] => 2018-03-14 00:00:02
)
)
)
Array
(
[Dima] => Array ([price] => 32) //максимальное значение прайса у Димы
[Nick] => Array ([price] => 91)//максимальное значение прайса у Ника
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question