Created
July 29, 2022 09:03
-
-
Save modos/34f01e74282108c34e974391183ff36d to your computer and use it in GitHub Desktop.
تا نوروز
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$d = readline(); | |
$e = explode("/", $d); | |
$days = 365; | |
if ($e[1] <= 6) { | |
$days = $days - 5 * 30 - 29; | |
$days = $days - (6 - $e[1]) * 31; | |
$days = $days - 31 + $e[2]; | |
}else if ($e[1] <= 11) { | |
$days = $days - 29; | |
$days = $days - (11 - $e[1]) * 30; | |
$days = $days - 30 + $e[2]; | |
}else { | |
$days = $days - 29 + $e[2]; | |
} | |
echo 365 - $days + 1; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment