Re: Making several variables into 1 variable

From: Date: Tue, 28 Jul 2009 13:40:21 +0000
Subject: Re: Making several variables into 1 variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-295919@lists.php.net to get a copy of this message
On Tue, Jul 28, 2009 at 6:32 AM, Miller, Terion<tmiller@springfi.gannett.com> wrote: > I need to take this: > >   $pastDays = strtotime("-30 days"); > > > > $past_day = date("d", $pastDays); > > $past_month = date("m", $pastDays); > > $past_year =date("y", $pastDays); > > > And make it into one var to compare to a db field that is formatted like > 00/00/00 Try: $past_date = date("m/d/y", $pastDays) Or even: $past_date = date ("m/d/y", time() - 2592000) (where 2592000 is 30 * 86400, and 86400 is the number of seconds in one day..) -- Richard S. Crawford (rscrawford@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)

« previous php.general (#295919) next »