- array_reverse: documentation ( source)
- print_r: documentation ( source)
- implode: documentation ( source)
- explode: documentation ( source)
- array_unique: documentation ( source)
<?php
$str = '1-string-2-string-3-string-55-otherstring-66-otherstring';
print_r(implode('-', array_reverse(array_unique(array_reverse(explode('-', $str))))));