Good day to all.
The task is as follows: by key, find the maximum value of the array and remove from the array all elements whose key is less than the maximum.
The array looks like this.
Array ( [response] => Array ( [count] => 41 [items] => Array ( [0] => Array ( [id] => 12345 [from_id] => 12345 [date] => 1480622801 [text] => Text [likes] => Array ( [count] => 0 ) ) ... I found a way to find the maximum value of the array -
foreach($members['response']['items'] as $k => $val){ $array_ataj[] = $val['likes']['count']; } echo max($array_ataj); But at the same time, I donβt know to leave the array with the maximum value (that is, to get the keys and values ββreturned) .. I ask for help in this matter.