I want to develop BirthDay CountDown calculator in PHP
User input the date DD-MM-YYYY
I have a days differnce calculator, but it calculates the days from between two specified years.
$daysfrom = $_POST['daysfrom'];
$daysto = $_POST['daysto'];
echo 'Difference of days B.W <b>' . $daysfrom . '</b>-<b>'.$daysto.'</b> are';
$daysto = strtotime($daysto);
$daysfrom = strtotime($daysfrom);
$datediff = $daysto - $daysfrom;
echo floor($datediff / (60 * 60 * 24));
And I have tried this calculate days between birthday.(I know this is not right)
User will input MM-DD-YYYY
and it should calculate days between months.
Ex: - Input: 13-03-1993
Output: (Assume todays date is 10-03-2014), it should display 03 Days left
if (isset($_POST['daysto'])) {
$daysto = $_POST['daysto'];
echo 'Your birthday comes within ';
$daysto = strtotime($daysto);
$now = strtotime(date('d-m'));
$datediff = $daysto - $now;
echo $datediff / 60 / 60 / 24;
}