![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
|
![]() I have the following code:
Quote:
I've searched a few different places and can't find anything specific to what I need ![]() Hopefully that makes sense? TIA for any help you can offer.
__________________
SOMETHING EXTREME IS COMING SOON! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2021
Posts: 103
|
Did you try 'last Sunday of the month'? PHP surprisingly can parse a lot of these things and do the heavy lifting for you
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,070
|
Google is your friend.
https://rosettacode.org/wiki/Find_th...each_month#PHP Like baodb said, you can use the string "last sunday of month year" in the date function to get the date of the last sunday. date('Y-m-d', strtotime('last sunday of ' . $month . ' ' . $year) Here is an example they have looping through and getting the last sunday of every month. // Created with PHP 7.0 function printLastSundayOfAllMonth($year) { $months = array( 'January', 'February', 'March', 'April', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); foreach ($months as $month) { echo $month . ': ' . date('Y-m-d', strtotime('last sunday of ' . $month . ' ' . $year)) . "\n"; } } printLastSundayOfAllMonth($argv[1]); .
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
|
I swear I searched for this in Google and Sitepoint and nothing came up :/
Thank you both.
__________________
SOMETHING EXTREME IS COMING SOON! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,032
|
Really never came across strtotime??
|
![]() |
![]() ![]() ![]() ![]() ![]() |