1 2 3 4 5
<?php $str = "1_2_3_4_5"; $arrNumbers = explode("_", $str); echo $arrNumbers[count($arrNumbers)-1]; //Should be 5.
1
5