php get last digit of number
snippet in php

php get last digit of number

user5506

$number = 12356;
$lastDigit = $number % 10;
echo $lastDigit; // 6