I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = October
$third_sunday = CalculateThirdSunday(October)
if ( ( TodaysDate before $third_sunday ) | ( TodaysDate == $third_sunday )
do something
else CalculateThirdSunday(November)
do something else
So the sorta pseudo-code above should reveal that I want a function that will always take the current month and calculate the third Sunday. Then if it's on or before that third sunday do something. However if it is after the the third Sunday, then we will calculate the third sunday of next month and then do something.
I can calculate what the third sunday out from now() is quite trivially:
<?PHP echo date('l jS F (Y-m-d)', strtotime('third Sunday')); ?>
But anyone got any idea how to find the third sunday from the beginning of the month? I tried something like
<?PHP echo date('l jS F (Y-m-d)', strtotime('2009-10-01 +third Sunday')); ?>
but that appears to not work. It tells me the next sunday is in Feb
SAP Logon Failed
I tried to login to SAP through MMC.
IS Retail & Manufacturing
Hi
Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.I have maxminds geoip lite installed and it works fine can retrieve the country and a city state every time no problem but it is not accurate it gets
Opening Multiple Files/Links in Order.
I want to open links in order/one-by-one and check each for a specific string.Example: If i open CL, search for ads pertaining to video games. Returns 20 results. I grab these links. Now i want to
Recording popularity by day, week.. all time?
Hey everyone, I'm creating a site designed around users uploading music. How can I implement a system that would effectively record information such as view count so that a user could find the most
Sendmail.php - heading error following check_input
Hi,I would greatly appreciate some help? I am brand new to PHP and have been searching and editing code ALL day :shrug:yet I still cannot find the reason for this error in my Sendmail.php
PHP submit form script causing blank page
Im trying to submit a form using this script, however nothing shows up on the page, does anyone know why it's not working?ThanksCode: <?php // Connects to your Database
PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php gamelet's say that the user should gain 1gold each minute but the user is not logged in and the process is
Best PHP Documentation generator
Hello guys!I would like to hear from you what is the best PHP documentation generator. Personally I use PHPDocumentor.What about Doxygen? It seems that Doxygen and PHPDocumentor have a very slight
Need help making a script that moves data into acrhive table
Hi,I'm kinda new to php/mysqlAnd i wrote a simple script to store sales lead for a buisness and they are posted out into a table after they are submitted in a form. The page where you can see all your