Anybody have a quick way of determining the number of days remaining in
the current month?

I'm currently using:

    $nextmonth = strftime("%Y-%m-01",strtotime("+1 month"))
    $monthdays = strftime("%d",strtotime($nextmonth)-86400);
    $daysleft  = $monthdays - strftime("%d",time());

I can obviously compact things into a single line, but it's enormous and
offends my sense of esthetics.  I was hoping I might be able to feed
something funky like "first day of next month" to strtotime, but the gnu
date input format isn't quite that flexible.

Any advice?  Is there an *elegant* way of doing this?

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development                   http://www.it.ca/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to