take last 10 digit of a number in php code example Example: php get last digit of number $number = 12356; $lastDigit = $number % 10; echo $lastDigit; // 6