// first two $year = substr($flightDates->departureDate->year, 0, 2); // last two $year = substr($flightDates->departureDate->year, -2);
$number = 12356; $lastDigit = $number % 10; echo $lastDigit; // 6