i have an Array Object like this :
[
{'id' : 1, 'school' : 'Harvard', 'score' : 90},
{'id' : 2, 'school' : 'LA University', 'score' : 50},
{'id' : 4, 'school' : 'Cairo', 'score' : 90},
{'id' : 3, 'school' : 'Monster University', 'score' : 70},
{'id' : 4, 'school' : 'Cairo', 'score' : 30},
{'id' : 1, 'school' : 'Harvard', 'score' : 80},
]
and my expected result is like this :
[
{'id' : 1, 'school' : 'Harvard', 'score' : 90},
{'id' : 2, 'school' : 'LA University', 'score' : 50},
{'id' : 3, 'school' : 'Monster University', 'score' : 70},
{'id' : 4, 'school' : 'Cairo', 'score' : 90},
]
i tried some function like array_unique
and array_intersect
but the result is different than i expected
so my purpose is get the higher score from the same record when the record have multiple record
hope you guys can help me
thanks