RE: [PHP] Re: best way to do this with arrays...
| From: | (Edward Peloke) | Date: | Mon, 24 May 2004 20:05:03 +0000 |
| Subject: | RE: [PHP] Re: best way to do this with arrays... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186840@lists.php.net to get a copy of this message | ||
the tricky part is I could have fifteen rows in the db all with different
start and end dates that I need to check each day against.
-----Original Message-----
From: Michal Migurski [mailto:mike@teczno.com]
Sent: Monday, May 24, 2004 10:18 AM
To: Torsten Roehr
Cc: php-general@lists.php.net
Subject: Re: [PHP] Re: best way to do this with arrays...
> $start = '2004-07-04';
> $end = '2004-07-09';
> $check = '2004-07-06'; // the date you want to check
>
> $timestampStart =
> mktime(0,0,0,substr($start,5,2),substr($start,8,2),substr($start,0,4));
> $timestampEnd =
> mktime(0,0,0,substr($end,5,2),substr($end,8,2),substr($end,0,4));
> $timestampCheck =
> mktime(0,0,0,substr($check,5,2),substr($check,8,2),substr($check,0,4));
FYI, the above can be shortened to:
$timestampStart = strtotime($start);
$timestampEnd = strtotime($end);
$timestampCheck = strtotime($check);
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php