number of days in a certain year


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function daysinyear($year)
  2. {
  3. $endyear = mktime(24, 0, 0, 12, 31, $year);
  4. $beginyear = mktime(0, 0, 0, 1, 1, $year);
  5. $diff = $endyear - $beginyear;
  6. $days = $diff / (60*60*24);
  7. return $days;
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.