tim_carter
asked on
PHP Date Object, Find last friday in a month
Hi Guys
I need to find out what date the last friday in a month is. Is there a way of doing this with php?
Thanks
I need to find out what date the last friday in a month is. Is there a way of doing this with php?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Squinky: Very cool! strtotime() is sheer genius! ~Ray
ASKER
Thanks guys. Awesome ;) I just found out about the strtotime yesterday.. If only knew about that earlier, it could have saved me so much thinking ;)
Right, strtotime() always beats thinking for me!
You might enjoy some of the books from SitePoint:
http://www.sitepoint.com/books/library/
They are usually pretty good. Happy coding!
You might enjoy some of the books from SitePoint:
http://www.sitepoint.com/books/library/
They are usually pretty good. Happy coding!
ASKER
$NumberOfDaysInCurrentMont
$LastFridayIs = 0;
for ($i=1;$i<$NumberOfDaysInCu
$DayNameTemp = date("D", mktime(0, 0, 0, $Month, $i, $Year));
if($DayNameTemp=='Fri')
$LastFridayIs = $i;
}
echo "LastFridayIs=".$LastFrida