- array_reverse: documentation ( source)
- print_r: documentation ( source)
- array_unique: documentation ( source)
<?php
$array=Array (
'0' => 2,
'1' => 1,
'2' => 3,
'3' => 5,
'4' => 1,
'5' => 2,
'6' => 1,
'7' => 4,
'8' => 2
);
print_r(array_reverse(array_unique(array_reverse($array))));