This commit is contained in:
sawontheboss4 2025-09-03 20:15:36 +06:00
parent dcaad31def
commit 972a342ba4
2 changed files with 6 additions and 3 deletions

View File

@ -22,12 +22,12 @@ function processInput($input) {
// Step 2: Filter only 17 digits long strings
if (preg_match('/^\d{17}$/', $cleanedInput)) {
// Step 3: Check if the first four digits are within 2007-2025
// Step 3: Check if the first four digits are within 2006-2025
$firstFourDigits = substr($cleanedInput, 0, 4);
if ($firstFourDigits >= 2007 && $firstFourDigits <= 2025) {
if ($firstFourDigits >= 2006 && $firstFourDigits <= 2025) {
return ['valid' => $cleanedInput];
} else {
return ['invalid' => $cleanedInput, 'reason' => 'First four digits are not within 2007-2025'];
return ['invalid' => $cleanedInput, 'reason' => 'First four digits are not within 2006-2025'];
}
} else {
return ['invalid' => $cleanedInput, 'reason' => 'Not 17 digits long'];

3
test.php Normal file
View File

@ -0,0 +1,3 @@
<?php
echo phpinfo();
?>