- print_r: documentation ( source)
- array_unique: documentation ( source)
<?php
class FanStruct{
public $date;
public $userid;
function __construct($date, $id){
$this->date = $date;
$this->userid = $id;
}
public function __toString()
{
return $this->date . $this->userid;
}
}
$test = array(
new FanStruct( 'today', 1 )
,new FanStruct( 'today', 1 )
,new FanStruct( 'tomorrow', 1 )
);
print_r( array_unique( $test ) );