PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php <form action = "" method = "GET"> <input name = "date"> <input type = "submit"> </form> <?php $date = date('d.m.Y'); $reg = "#(\d{2}).(\d{2}).\d{4}#"; preg_match($reg,$_GET['date'],$arr); preg_match($reg,$date,$arr1); echo $dr = date("z", mktime(0, 0, 0, $arr[2], $arr[1], 2022)).'</br>'; echo $present = 1+date("z", mktime(0, 0, 0, $arr1[2], $arr1[1], 2022)).'</br>'; if($dr<$present){ if(date('Y')%4 == 0){ echo (366-$present)+($present - ($present - $dr))+1; } else { echo (365-$present)+($present - ($present - $dr))+1; } } else if($dr>$present){ echo $dr - $present; } else if($dr = $present){ echo 0; } ?>
Show:  
Copy Clear