1 2 3 4 5
<?php $string = 'abc-123-xyz-789'; $output = array_pop(explode("-",$string)); echo $output; ?>
1
789