Re: [PHP] Last Friday of every month

2008-03-14 Thread Aschwin Wesselius
VamVan wrote: Can you tell me how to do this ? suppose I have a date variable = '02/23/2008' i need to know if this is the last friday of february let me know. $month = 3; $year = 2008; for ($day = 31; $day = 21; $day--) { // maximum of 7 days, but february starts at 28

Re: [PHP] Last Friday of every month

2008-03-14 Thread Richard Heyes
VamVan wrote: Can you tell me how to do this ? suppose I have a date variable = '02/23/2008' i need to know if this is the last friday of february Work backwards from the 28th subtracting 86400 from your Unix timestamp until you get to a Friday. Compare this with your variable. --

Re: [PHP] Last Friday of every month

2008-03-14 Thread Eric Butera
On Thu, Mar 13, 2008 at 9:39 PM, Andrés Robinet [EMAIL PROTECTED] wrote: -Original Message- From: VamVan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 9:13 PM To: php-general@lists.php.net Subject: [PHP] Last Friday of every month Can you tell me how to do

Re: [PHP] Last Friday of every month

2008-03-14 Thread tedd
At 8:17 AM -0400 3/14/08, Eric Butera wrote: Just FYI you can use the word last friday in strtotime. So really you could check and see if the max day in a month is a friday and if not fall back on last friday. I didn't test it but I just thought I'd throw that out there. erics:~ eric$ php -r

Re: [PHP] Last Friday of every month

2008-03-14 Thread Philip Thompson
On Mar 13, 2008, at 8:12 PM, VamVan wrote: Can you tell me how to do this ? suppose I have a date variable = '02/23/2008' i need to know if this is the last friday of february let me know. There are plenty of ways. Here's a couple: OS X: 1. Finder Applications iCal (or Command-space

Re: [PHP] Last Friday of every month

2008-03-14 Thread Philip Thompson
On Mar 14, 2008, at 11:44 AM, Philip Thompson wrote: On Mar 13, 2008, at 8:12 PM, VamVan wrote: Can you tell me how to do this ? suppose I have a date variable = '02/23/2008' i need to know if this is the last friday of february let me know. There are plenty of ways. Here's a couple:

Re: [PHP] Last Friday of every month

2008-03-14 Thread Eric Butera
On Fri, Mar 14, 2008 at 11:57 AM, tedd [EMAIL PROTECTED] wrote: At 8:17 AM -0400 3/14/08, Eric Butera wrote: Just FYI you can use the word last friday in strtotime. So really you could check and see if the max day in a month is a friday and if not fall back on last friday. I didn't

Re: [PHP] Last Friday of every month

2008-03-14 Thread tedd
At 1:03 PM -0400 3/14/08, Eric Butera wrote: On Fri, Mar 14, 2008 at 11:57 AM, tedd [EMAIL PROTECTED] wrote: You were right -- here it is: http://webbytedd.com/b1/last-friday/ Hi Tedd, Thanks for the writeup! You could streamline that a bit by using getdate() and using the

RE: [PHP] Last Friday of every month

2008-03-13 Thread Andrés Robinet
-Original Message- From: VamVan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 9:13 PM To: php-general@lists.php.net Subject: [PHP] Last Friday of every month Can you tell me how to do this ? suppose I have a date variable = '02/23/2008' i need to know if this is