OrangeHairedBoy wrote:

Hi all,

I'm trying to write a script to get the next last friday of the month and I
am failing miserably. It keeps giving me October 10th. So, I scrapped it.

Basically, I just want to show what the last friday of the month is, and if
that date has already passed, show the last friday of the next month.

How can I do that?



You can get the number of days in a month from date()

Now you know that the last Friday of the month will be at most 7 days from the end of the month,
loop through the last 7 days of the month and determine what date it is using the date() function.
Compare the date to determine if it is Friday or not.


And then add in the check for if the date has passed or not.

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



Reply via email to