Или PHP: <? $a = '234768656756'; // Получаем две последние цифры if(preg_match('/([\d]{2})$/s', $a, $last) { $numbers = $last[1]; $last = array(); } // Выводим их echo $numbers; ?>