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
IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with the php function getimagesize() and path names.When using these two different sets of code:Code:
use an array from 1 class in a second class
I have a class that adds data to an arrayThen I have a second class and I need to check if the data it returns is in the array created in the first class.But I get undefined variable: Array
Linking with Foreign Keys
I have been getting an erro when I try and link:
Any meaningful project for a new C++ programmer?
I want to do some meaningful program, so I can help myself to learn
mail() problem
Hi Guys,I've set up a contact email form. It sends the information fine, but it sends it to the junk folder.If I just use this command:$headers = "MIME-Version: 1.0 \n";It will send it to
Career Change into SAP
Hai
Guixt issue
Hello all,
PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 2008 box that is running Apache 2.2.14, PHP 5.2.11, and MySQL 5.1.39. My problem is I am trying to call
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.I have roughly 30 files. I want to be able to edit every $_POST and $_GETCode:
Random date selection
i want to select random date with time(hour+minutes+sec) where date is specified(10/22/2009) and timestamp is specified 10-11 am