I am trying to get a pro-rated subscription price based on when they sign up.

I order to get the number of days between today and the end of the year, I first have to know I need to get the number of days in THIS year - since there are leap years.

I think this code will work for getting the #days between now and end of year:
PHP Code:
$year_end Year(date())."-12-31";
$date_diff roundabs(strtotime(date('y-m-d'))-strtotime($year_end)) / 86400); 
I still need help getting the # days in whatever year we are in.

Any ideas besides calling the easy MySQL DATEDIFF() function?

something like:
($date_diff/(total number of days this year)) * pricing