extract highest row from array

Team,

I have an array of results from query and want to use the rows which have latest timestamp.

So array have data like (username :abc,id,1,timestamp1) , same user have another entry but with different timestamp. Max is not doing the trick , any idea ?

  Discussion posts and replies are publicly visible