How to calculate the number of days between current day and your birthday in PHP

1 Answer

0 votes
$birthday = mktime(0,0,0,2,27,1966);
$today = time();
$total_days = (int)(($today - $birthday)/86400); // 86400 = amount of seconds in a day

echo $total_days;
 
 
 
/*
run:
      
19370
     
*/

 



answered Mar 11, 2019 by avibootz
...