I have an object like this:
class FanStruct{
public $date;
public $userid;
function __construct($date, $id){
$this->date = $date;
$this->userid = $id;
}
}
I have maximum of 30 of them in an array, and they are sorted by $userid
.
What is the best way to go though the array, and remove duplicate objects based on $userid
(ignoring $date
)?