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
Inserting into MySQL Newbie
Hi ive got a slight problem where ive made a simple web form where the customer inserts the ammount of tickets and then enters their personal details... then this form does the post method and it then
Forum tutorial
Im a beginner in PHP. Im making a forum(previous questbook, counter and few others) to learn. For now I know something. I started making the forum from this
need help in dynamic select menu in php
hi i have created a dynamic select menu using php. i have a problem in that which is when the user select any value in that menu and press submit then it does not pass to next page.my code is
limit string by words??
hello all,I was wonder if there is a function to limit a string by the number of words instead of characters?
help with image upload code
Hello,right now this code I have resizes images and then places them into the uploads folder is there a way to make this code upload the orignal file sizes into uploads and make it put the smaller
data type in column definition
Hi,
Mail functionality from localhost to server
Hi I am facing problem of mail functionality.When i tested mail functionality in my localhost it works fine but when i tried it on server it didn't work and also no error it displays.So please give me
a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weight, 0 = 70, 71 = 100, 101 = 150, each zone has an average number of say about 0.147 and a Base number
upload control not working with update panel
Hi,I am working with Asp.Net FileUpload control with ajax update panel,if i use the AsyncPostBackTrigger,i am unable to get the filename in serverside,but if i use PostBackTrigger its working fine
Thread in PHP
Thread in PHPSome basic use and basic code for thread in phpThis is my question?